1 # This file was written by Sue Kimura. (sue_kimura@hp.com)
3 # Test for CLLbs14602 -- problem with recognizing long double on 10.20.
5 # Source file: bs14602.c
11 if { [skip_hp_tests] } { continue }
14 # test running programs
21 set srcfile ${testfile}.c
22 set binfile ${objdir}/${subdir}/${testfile}
24 # Create and source the file that provides information about the compiler
25 # used to compile the test case.
26 if [get_compiler_info ${binfile}] {
30 # set up appropriate compile option to recognize long double
31 if {$hp_aCC_compiler || $hp_cc_compiler} {
37 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "$binfile" executable "debug {additional_flags=${ansi_option}}"] != "" } {
38 perror "Couldn't compile ${srcfile}"
43 # Start with a fresh gdb.
47 gdb_reinitialize_dir $srcdir/$subdir
51 # get to end of main so we can check out some stuff
53 perror "couldn't run to breakpoint main"
58 "Breakpoint $decimal at $hex: file .*bs14602.c, line 9." \
59 "set breakpoint at end of main"
62 "Continuing.\r\n$hex in main* \\(\\) at .*bs14602.c:9\r\n.*" \
63 "continue to end of main"
65 # test some simple things about long double
66 gdb_test "whatis v_long_double" \
67 "type = long double" \
68 "whatis v_long_double"
70 gdb_test "ptype v_long_double" \
71 "type = long double" \
74 gdb_test "print sizeof \(long double\)" \
76 "print sizeof long double"
78 gdb_test "print sizeof \(v_long_double\)" \
80 "print sizeof v_long_double"
82 gdb_test "print v_long_double" \
83 " = 12345.67890000000079453457146883011" \
84 "print v_long_double - 1"
86 gdb_test "set variable v_long_double = 98765.43210" \
88 "set variable v_long_double to constant value"
90 gdb_test "print v_long_double" \
91 " = 98765.43210000000544823706150054932" \
92 "print v_long_double - 2"
94 gdb_test "set variable v_double = v_long_double" \
96 " set variable v_double with v_long_double"
98 gdb_test "print v_double" \
99 " = 98765.432100000005" \
103 gdb_test "set variable v_long_double = 0" \
105 "reset v_long_double to 0"
107 gdb_test "print v_long_double" \
109 "print v_long_double - 3"
111 gdb_test "set variable v_long_double = v_double" \
113 " set variable v_long_double with v_long_double"
115 gdb_test "print v_long_double" \
116 " = 98765.43210000000544823706150054932" \
117 "print v_long_double - 4 "