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
20 # set up appropriate compile option to recognize long double
22 if [istarget "hppa*-*-*"] {
27 set srcfile ${testfile}.c
28 set binfile ${objdir}/${subdir}/${testfile}
30 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "$binfile" executable "debug {additional_flags=${ansi_option}}"] != "" } {
31 perror "Couldn't compile ${srcfile}"
36 # Start with a fresh gdb.
40 gdb_reinitialize_dir $srcdir/$subdir
44 # get to end of main so we can check out some stuff
46 perror "couldn't run to breakpoint main"
51 "Breakpoint $decimal at $hex: file .*bs14602.c, line 9." \
52 "set breakpoint at end of main"
55 "Continuing.\r\n$hex in main* \\(\\) at .*bs14602.c:9\r\n.*" \
56 "continue to end of main"
58 # test some simple things about long double
59 gdb_test "whatis v_long_double" \
60 "type = long double" \
61 "whatis v_long_double"
63 gdb_test "ptype v_long_double" \
64 "type = long double" \
67 gdb_test "print sizeof \(long double\)" \
69 "print sizeof long double"
71 gdb_test "print sizeof \(v_long_double\)" \
73 "print sizeof v_long_double"
75 gdb_test "print v_long_double" \
76 " = 12345.67890000000079453457146883011" \
77 "print v_long_double - 1"
79 gdb_test "set variable v_long_double = 98765.43210" \
81 "set variable v_long_double to constant value"
83 gdb_test "print v_long_double" \
84 " = 98765.43210000000544823706150054932" \
85 "print v_long_double - 2"
87 gdb_test "set variable v_double = v_long_double" \
89 " set variable v_double with v_long_double"
91 gdb_test "print v_double" \
92 " = 98765.432100000005" \
96 gdb_test "set variable v_long_double = 0" \
98 "reset v_long_double to 0"
100 gdb_test "print v_long_double" \
102 "print v_long_double - 3"
104 gdb_test "set variable v_long_double = v_double" \
106 " set variable v_long_double with v_long_double"
108 gdb_test "print v_long_double" \
109 " = 98765.43210000000544823706150054932" \
110 "print v_long_double - 4 "