OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-6.8/] [gdb/] [testsuite/] [gdb.hp/] [gdb.defects/] [bs14602.exp] - Blame information for rev 157

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 24 jeremybenn
# 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 $tracelevel {
8
    strace $tracelevel
9
}
10
 
11
if { [skip_hp_tests] } { continue }
12
 
13
#
14
# test running programs
15
#
16
set prms_id 0
17
set bug_id 0
18
 
19
 
20
set testfile bs14602
21
set srcfile ${testfile}.c
22
set binfile ${objdir}/${subdir}/${testfile}
23
 
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;
28
}
29
 
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 ""
35
}
36
 
37
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "$binfile" executable "debug {additional_flags=${ansi_option}}"] != "" } {
38
    perror "Couldn't compile ${srcfile}"
39
    return -1
40
}
41
 
42
 
43
# Start with a fresh gdb.
44
 
45
gdb_exit
46
gdb_start
47
gdb_reinitialize_dir $srcdir/$subdir
48
gdb_load $binfile
49
 
50
 
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
55
}
56
 
57
gdb_test "txbreak" \
58
    "Breakpoint $decimal at $hex: file .*bs14602.c, line 9." \
59
    "set breakpoint at end of main"
60
 
61
gdb_test "continue" \
62
    "Continuing.\r\n$hex in main* \\(\\) at .*bs14602.c:9\r\n.*" \
63
    "continue to end of main"
64
 
65
# test some simple things about long double
66
gdb_test "whatis v_long_double" \
67
    "type = long double" \
68
    "whatis v_long_double"
69
 
70
gdb_test "ptype v_long_double" \
71
    "type = long double" \
72
    "ptype v_long_double"
73
 
74
gdb_test "print sizeof \(long double\)" \
75
    " = 16" \
76
    "print sizeof long double"
77
 
78
gdb_test "print sizeof \(v_long_double\)" \
79
    " = 16" \
80
    "print sizeof v_long_double"
81
 
82
gdb_test "print v_long_double"  \
83
    " = 12345.67890000000079453457146883011" \
84
    "print v_long_double - 1"
85
 
86
gdb_test "set variable v_long_double = 98765.43210" \
87
    "" \
88
    "set variable v_long_double to constant value"
89
 
90
gdb_test "print v_long_double" \
91
    " = 98765.43210000000544823706150054932" \
92
    "print v_long_double - 2"
93
 
94
gdb_test "set variable v_double = v_long_double" \
95
    "" \
96
    " set variable v_double with v_long_double"
97
 
98
gdb_test "print v_double" \
99
    " = 98765.432100000005" \
100
    " print v_double"
101
 
102
#reset v_long_double
103
gdb_test "set variable v_long_double = 0" \
104
    "" \
105
    "reset v_long_double to 0"
106
 
107
gdb_test "print v_long_double" \
108
    " = 0" \
109
    "print v_long_double - 3"
110
 
111
gdb_test "set variable v_long_double = v_double" \
112
    "" \
113
    " set variable v_long_double with v_long_double"
114
 
115
gdb_test "print v_long_double" \
116
    " = 98765.43210000000544823706150054932" \
117
    "print v_long_double - 4 "

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.