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

Subversion Repositories openrisc_me

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 330 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
 
17
 
18
set testfile bs14602
19
set srcfile ${testfile}.c
20
set binfile ${objdir}/${subdir}/${testfile}
21
 
22
# Create and source the file that provides information about the compiler
23
# used to compile the test case.
24
if [get_compiler_info ${binfile}] {
25
    return -1;
26
}
27
 
28
# set up appropriate compile option to recognize long double
29
if {$hp_aCC_compiler || $hp_cc_compiler} {
30
    set ansi_option "-Ae"
31
} else {
32
    set ansi_option ""
33
}
34
 
35
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "$binfile" executable "debug {additional_flags=${ansi_option}}"] != "" } {
36
    perror "Couldn't compile ${srcfile}"
37
    return -1
38
}
39
 
40
 
41
# Start with a fresh gdb.
42
 
43
gdb_exit
44
gdb_start
45
gdb_reinitialize_dir $srcdir/$subdir
46
gdb_load $binfile
47
 
48
 
49
# get to end of main so we can check out some stuff
50
if ![runto main] {
51
  perror "couldn't run to breakpoint main"
52
  continue
53
}
54
 
55
gdb_test "txbreak" \
56
    "Breakpoint $decimal at $hex: file .*bs14602.c, line 9." \
57
    "set breakpoint at end of main"
58
 
59
gdb_test "continue" \
60
    "Continuing.\r\n$hex in main* \\(\\) at .*bs14602.c:9\r\n.*" \
61
    "continue to end of main"
62
 
63
# test some simple things about long double
64
gdb_test "whatis v_long_double" \
65
    "type = long double" \
66
    "whatis v_long_double"
67
 
68
gdb_test "ptype v_long_double" \
69
    "type = long double" \
70
    "ptype v_long_double"
71
 
72
gdb_test "print sizeof \(long double\)" \
73
    " = 16" \
74
    "print sizeof long double"
75
 
76
gdb_test "print sizeof \(v_long_double\)" \
77
    " = 16" \
78
    "print sizeof v_long_double"
79
 
80
gdb_test "print v_long_double"  \
81
    " = 12345.67890000000079453457146883011" \
82
    "print v_long_double - 1"
83
 
84
gdb_test "set variable v_long_double = 98765.43210" \
85
    "" \
86
    "set variable v_long_double to constant value"
87
 
88
gdb_test "print v_long_double" \
89
    " = 98765.43210000000544823706150054932" \
90
    "print v_long_double - 2"
91
 
92
gdb_test "set variable v_double = v_long_double" \
93
    "" \
94
    " set variable v_double with v_long_double"
95
 
96
gdb_test "print v_double" \
97
    " = 98765.432100000005" \
98
    " print v_double"
99
 
100
#reset v_long_double
101
gdb_test "set variable v_long_double = 0" \
102
    "" \
103
    "reset v_long_double to 0"
104
 
105
gdb_test "print v_long_double" \
106
    " = 0" \
107
    "print v_long_double - 3"
108
 
109
gdb_test "set variable v_long_double = v_double" \
110
    "" \
111
    " set variable v_long_double with v_long_double"
112
 
113
gdb_test "print v_long_double" \
114
    " = 98765.43210000000544823706150054932" \
115
    "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.