gcc/
[official-gcc.git] / gcc / testsuite / g++.dg / guality / guality.exp
blob121522c3515e1aeae9e2f7f17a89107a9feae77d
1 # This harness is for tests that should be run at all optimisation levels.
3 load_lib g++-dg.exp
4 load_lib gcc-gdb-test.exp
6 # Disable on darwin until radr://7264615 is resolved.
7 if { [istarget *-*-darwin*] } {
8 return
11 if { [istarget "powerpc-ibm-aix*"] } {
12 set torture_execute_xfail "powerpc-ibm-aix*"
13 return
16 proc check_guality {args} {
17 # Don't count check_guality as PASS, or FAIL etc., that would make
18 # the total PASS count dependent on how many parallel runtest invocations
19 # ran guality.exp. So save the counts first and restore them afterwards.
20 global test_counts
21 array set saved_test_counts [array get test_counts]
22 set result [eval check_compile guality_check executable $args "-g -O0"]
23 set lines [lindex $result 0]
24 set output [lindex $result 1]
25 set ret 0
26 if {[string match "" $lines]} {
27 set execout [g++_load "./$output"]
28 set ret [string match "*1 PASS, 0 FAIL, 0 UNRESOLVED*" $execout]
30 remote_file build delete $output
31 array get test_counts [array get saved_test_counts]
32 return $ret
35 dg-init
37 global GDB
38 if ![info exists ::env(GUALITY_GDB_NAME)] {
39 if [info exists GDB] {
40 set guality_gdb_name "$GDB"
41 } else {
42 set guality_gdb_name "[transform gdb]"
44 setenv GUALITY_GDB_NAME "$guality_gdb_name"
47 if {[check_guality "
48 #include \"$srcdir/$subdir/guality.h\"
49 volatile long int varl = 6;
50 int main (int argc, char *argv\[\])
52 GUALCHKVAL (varl);
53 return 0;
55 "]} {
56 gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.C]] "" ""
57 gcc-dg-runtest [lsort [glob $srcdir/c-c++-common/guality/*.c]] "" ""
60 if [info exists guality_gdb_name] {
61 unsetenv GUALITY_GDB_NAME
64 dg-finish