import gdb-1999-08-16 snapshot
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.hp / gdb.defects / bs14602.exp
1 # This file was written by Sue Kimura. (sue_kimura@hp.com)
2 #
3 # Test for CLLbs14602 -- problem with recognizing long double on 10.20.
4 #
5 # Source file: bs14602.c
6
7 if $tracelevel {
8 strace $tracelevel
9 }
10
11 if { [skip_hp_tests] } { continue }
12
13 #
14 # test running programs
15 #
16 set prms_id 0
17 set bug_id 0
18
19
20 # set up appropriate compile option to recognize long double
21 set ansi_option ""
22 if [istarget "hppa*-*-*"] {
23 set ansi_option "-Ae"
24 }
25
26 set testfile bs14602
27 set srcfile ${testfile}.c
28 set binfile ${objdir}/${subdir}/${testfile}
29
30 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "$binfile" executable "debug {additional_flags=${ansi_option}}"] != "" } {
31 perror "Couldn't compile ${srcfile}"
32 return -1
33 }
34
35
36 # Start with a fresh gdb.
37
38 gdb_exit
39 gdb_start
40 gdb_reinitialize_dir $srcdir/$subdir
41 gdb_load $binfile
42
43
44 # get to end of main so we can check out some stuff
45 if ![runto main] {
46 perror "couldn't run to breakpoint main"
47 continue
48 }
49
50 gdb_test "txbreak" \
51 "Breakpoint $decimal at $hex: file .*bs14602.c, line 9." \
52 "set breakpoint at end of main"
53
54 gdb_test "continue" \
55 "Continuing.\r\n$hex in main* \\(\\) at .*bs14602.c:9\r\n.*" \
56 "continue to end of main"
57
58 # test some simple things about long double
59 gdb_test "whatis v_long_double" \
60 "type = long double" \
61 "whatis v_long_double"
62
63 gdb_test "ptype v_long_double" \
64 "type = long double" \
65 "ptype v_long_double"
66
67 gdb_test "print sizeof \(long double\)" \
68 " = 16" \
69 "print sizeof long double"
70
71 gdb_test "print sizeof \(v_long_double\)" \
72 " = 16" \
73 "print sizeof v_long_double"
74
75 gdb_test "print v_long_double" \
76 " = 12345.67890000000079453457146883011" \
77 "print v_long_double - 1"
78
79 gdb_test "set variable v_long_double = 98765.43210" \
80 "" \
81 "set variable v_long_double to constant value"
82
83 gdb_test "print v_long_double" \
84 " = 98765.43210000000544823706150054932" \
85 "print v_long_double - 2"
86
87 gdb_test "set variable v_double = v_long_double" \
88 "" \
89 " set variable v_double with v_long_double"
90
91 gdb_test "print v_double" \
92 " = 98765.432100000005" \
93 " print v_double"
94
95 #reset v_long_double
96 gdb_test "set variable v_long_double = 0" \
97 "" \
98 "reset v_long_double to 0"
99
100 gdb_test "print v_long_double" \
101 " = 0" \
102 "print v_long_double - 3"
103
104 gdb_test "set variable v_long_double = v_double" \
105 "" \
106 " set variable v_long_double with v_long_double"
107
108 gdb_test "print v_long_double" \
109 " = 98765.43210000000544823706150054932" \
110 "print v_long_double - 4 "
This page took 0.064053 seconds and 4 git commands to generate.