Sync usage with man page.
[netbsd-mini2440.git] / gnu / dist / gdb6 / gdb / testsuite / gdb.hp / gdb.defects / bs14602.exp
blobd1500f01bd01843fb13111d43b9514062bbdcc58
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 $tracelevel {
8 strace $tracelevel
11 if { [skip_hp_tests] } { continue }
14 # test running programs
16 set prms_id 0
17 set bug_id 0
20 set testfile bs14602
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}] {
27 return -1;
30 # set up appropriate compile option to recognize long double
31 if {$hp_aCC_compiler || $hp_cc_compiler} {
32 set ansi_option "-Ae"
33 } else {
34 set ansi_option ""
37 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "$binfile" executable "debug {additional_flags=${ansi_option}}"] != "" } {
38 perror "Couldn't compile ${srcfile}"
39 return -1
43 # Start with a fresh gdb.
45 gdb_exit
46 gdb_start
47 gdb_reinitialize_dir $srcdir/$subdir
48 gdb_load $binfile
51 # get to end of main so we can check out some stuff
52 if ![runto main] {
53 perror "couldn't run to breakpoint main"
54 continue
57 gdb_test "txbreak" \
58 "Breakpoint $decimal at $hex: file .*bs14602.c, line 9." \
59 "set breakpoint at end of main"
61 gdb_test "continue" \
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" \
72 "ptype v_long_double"
74 gdb_test "print sizeof \(long double\)" \
75 " = 16" \
76 "print sizeof long double"
78 gdb_test "print sizeof \(v_long_double\)" \
79 " = 16" \
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" \
87 "" \
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" \
95 "" \
96 " set variable v_double with v_long_double"
98 gdb_test "print v_double" \
99 " = 98765.432100000005" \
100 " print v_double"
102 #reset v_long_double
103 gdb_test "set variable v_long_double = 0" \
104 "" \
105 "reset v_long_double to 0"
107 gdb_test "print v_long_double" \
108 " = 0" \
109 "print v_long_double - 3"
111 gdb_test "set variable v_long_double = v_double" \
112 "" \
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 "