Support R_SPARC_WDISP10 and R_SPARC_H34.
[external/binutils.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 { [skip_hp_tests] } { continue }
8
9 #
10 # test running programs
11 #
12
13
14 set testfile bs14602
15 set srcfile ${testfile}.c
16 set binfile ${objdir}/${subdir}/${testfile}
17
18 # Create and source the file that provides information about the compiler
19 # used to compile the test case.
20 if [get_compiler_info ${binfile}] {
21     return -1;
22 }
23
24 # set up appropriate compile option to recognize long double
25 if {$hp_aCC_compiler || $hp_cc_compiler} {
26     set ansi_option "-Ae"
27 } else {
28     set ansi_option ""
29 }
30
31 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "$binfile" executable "debug {additional_flags=${ansi_option}}"] != "" } {
32     perror "Couldn't compile ${srcfile}"
33     return -1
34 }
35
36
37 # Start with a fresh gdb.
38
39 gdb_exit
40 gdb_start
41 gdb_reinitialize_dir $srcdir/$subdir
42 gdb_load $binfile
43
44
45 # get to end of main so we can check out some stuff
46 if ![runto main] {
47   perror "couldn't run to breakpoint main"
48   continue
49 }
50
51 gdb_test "txbreak" \
52     "Breakpoint $decimal at $hex: file .*bs14602.c, line 9." \
53     "set breakpoint at end of main"
54
55 gdb_test "continue" \
56     "Continuing.\r\n$hex in main* \\(\\) at .*bs14602.c:9\r\n.*" \
57     "continue to end of main"
58
59 # test some simple things about long double
60 gdb_test "whatis v_long_double" \
61     "type = long double" \
62     "whatis v_long_double"
63
64 gdb_test "ptype v_long_double" \
65     "type = long double" \
66     "ptype v_long_double"
67
68 gdb_test "print sizeof \(long double\)" \
69     " = 16" \
70     "print sizeof long double"
71
72 gdb_test "print sizeof \(v_long_double\)" \
73     " = 16" \
74     "print sizeof v_long_double"
75
76 gdb_test "print v_long_double"  \
77     " = 12345.67890000000079453457146883011" \
78     "print v_long_double - 1" 
79
80 gdb_test "set variable v_long_double = 98765.43210" \
81     "" \
82     "set variable v_long_double to constant value"
83
84 gdb_test "print v_long_double" \
85     " = 98765.43210000000544823706150054932" \
86     "print v_long_double - 2" 
87
88 gdb_test "set variable v_double = v_long_double" \
89     "" \
90     " set variable v_double with v_long_double"
91
92 gdb_test "print v_double" \
93     " = 98765.432100000005" \
94     " print v_double"
95
96 #reset v_long_double
97 gdb_test "set variable v_long_double = 0" \
98     "" \
99     "reset v_long_double to 0"
100
101 gdb_test "print v_long_double" \
102     " = 0" \
103     "print v_long_double - 3"
104
105 gdb_test "set variable v_long_double = v_double" \
106     "" \
107     " set variable v_long_double with v_long_double"
108
109 gdb_test "print v_long_double" \
110     " = 98765.43210000000544823706150054932" \
111     "print v_long_double - 4 "