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
7 if { [skip_hp_tests] } { continue }
10 # test running programs
15 set srcfile ${testfile}.c
16 set binfile ${objdir}/${subdir}/${testfile}
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}] {
24 # set up appropriate compile option to recognize long double
25 if {$hp_aCC_compiler || $hp_cc_compiler} {
31 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "$binfile" executable "debug {additional_flags=${ansi_option}}"] != "" } {
32 perror "Couldn't compile ${srcfile}"
37 # Start with a fresh gdb.
41 gdb_reinitialize_dir $srcdir/$subdir
45 # get to end of main so we can check out some stuff
47 perror "couldn't run to breakpoint main"
52 "Breakpoint $decimal at $hex: file .*bs14602.c, line 9." \
53 "set breakpoint at end of main"
56 "Continuing.\r\n$hex in main* \\(\\) at .*bs14602.c:9\r\n.*" \
57 "continue to end of main"
59 # test some simple things about long double
60 gdb_test "whatis v_long_double" \
61 "type = long double" \
62 "whatis v_long_double"
64 gdb_test "ptype v_long_double" \
65 "type = long double" \
68 gdb_test "print sizeof \(long double\)" \
70 "print sizeof long double"
72 gdb_test "print sizeof \(v_long_double\)" \
74 "print sizeof v_long_double"
76 gdb_test "print v_long_double" \
77 " = 12345.67890000000079453457146883011" \
78 "print v_long_double - 1"
80 gdb_test "set variable v_long_double = 98765.43210" \
82 "set variable v_long_double to constant value"
84 gdb_test "print v_long_double" \
85 " = 98765.43210000000544823706150054932" \
86 "print v_long_double - 2"
88 gdb_test "set variable v_double = v_long_double" \
90 " set variable v_double with v_long_double"
92 gdb_test "print v_double" \
93 " = 98765.432100000005" \
97 gdb_test "set variable v_long_double = 0" \
99 "reset v_long_double to 0"
101 gdb_test "print v_long_double" \
103 "print v_long_double - 3"
105 gdb_test "set variable v_long_double = v_double" \
107 " set variable v_long_double with v_long_double"
109 gdb_test "print v_long_double" \
110 " = 98765.43210000000544823706150054932" \
111 "print v_long_double - 4 "