1 # This harness is
for tests that should be run at all optimisation levels.
4 load_lib gcc
-gdb
-test.exp
6 # Disable
on darwin until radr
://7264615 is resolved.
7 if { [istarget
*-*-darwin
*] } {
11 if { [istarget hppa
*-*-hpux
*] } {
15 if { [istarget
"powerpc-ibm-aix*"] } {
16 set torture_execute_xfail
"powerpc-ibm-aix*"
20 proc check_guality
{args} {
21 # Don
't count check_guality as PASS, or FAIL etc., that would make
22 # the total PASS count dependent on how many parallel runtest invocations
23 # ran guality.exp. So save the counts first and restore them afterwards.
25 array set saved_test_counts [array get test_counts]
26 set result [eval check_compile guality_check executable $args "-g -O0"]
27 set lines [lindex $result 0]
28 set output [lindex $result 1]
30 if {[string match "" $lines]} {
31 set execout [gcc_load "./$output"]
32 set ret [string match "*1 PASS, 0 FAIL, 0 UNRESOLVED*" $execout]
34 remote_file build delete $output
35 array set test_counts [array get saved_test_counts]
42 if ![info exists ::env(GUALITY_GDB_NAME)] {
43 if [info exists GDB] {
44 set guality_gdb_name "$GDB"
45 } elseif { [info exists rootme] && [file exists $rootme/../gdb/gdb] } {
46 # If we're doing a combined build
, and gdb is available
, use it.
47 set guality_gdb_name
"$rootme/../gdb/gdb"
49 set guality_gdb_name
"[transform gdb]"
51 setenv GUALITY_GDB_NAME
"$guality_gdb_name"
53 report_gdb $
::env
(GUALITY_GDB_NAME
) [info script
]
55 proc guality_transform_options
{ args } {
57 foreach opt
[lindex $
args 0] {
59 if { ! [regexp
-- "-O0" $opt] } {
60 set opt
"$opt -DPREVENT_OPTIMIZATION"
68 global DG_TORTURE_OPTIONS
69 set guality_dg_torture_options
[guality_minimal_options $DG_TORTURE_OPTIONS
]
70 set guality_dg_torture_options
[guality_transform_options $guality_dg_torture_options
]
71 set guality_lto_torture_options
[guality_transform_options $LTO_TORTURE_OPTIONS
]
74 $guality_dg_torture_options \
76 $guality_lto_torture_options
79 #
include \"$srcdir
/$subdir
/guality.h
\"
80 volatile long
int varl
= 6;
81 int main
(int argc
, char
*argv\
[\
])
89 foreach file
[lsort
[glob $srcdir
/c
-c
++-common
/guality
/*.c
]] {
90 switch -glob
-- [file tail $file
] {
91 Og
-* { lappend Og $file
}
92 * { lappend general $file
}
96 gcc
-dg
-runtest
[lsort
[glob $srcdir
/$subdir
/*.c
]] "" ""
97 gcc
-dg
-runtest $general
"" "-Wc++-compat"
102 gcc
-dg
-runtest $Og
"" "-Wc++-compat"
105 if [info exists guality_gdb_name
] {
106 unsetenv GUALITY_GDB_NAME