Skip guality tests on hppa-hpux.
[official-gcc.git] / gcc / testsuite / g++.dg / guality / guality.exp
blob2d736d292e93bbe1b7d04373229b6212b6fc40ec
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 hppa*-*-hpux*] } {
12 return
15 if { [istarget "powerpc-ibm-aix*"] } {
16 set torture_execute_xfail "powerpc-ibm-aix*"
17 return
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.
24 global test_counts
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]
29 set ret 0
30 if {[string match "" $lines]} {
31 set execout [g++_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]
36 return $ret
39 dg-init
41 global GDB
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"
48 } else {
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 global DG_TORTURE_OPTIONS LTO_TORTURE_OPTIONS
56 set guality_dg_torture_options [guality_minimal_options $DG_TORTURE_OPTIONS]
57 torture-init
58 set-torture-options \
59 $guality_dg_torture_options \
60 [list {}] \
61 $LTO_TORTURE_OPTIONS
63 if {[check_guality "
64 #include \"$srcdir/$subdir/guality.h\"
65 volatile long int varl = 6;
66 int main (int argc, char *argv\[\])
68 GUALCHKVAL (varl);
69 return 0;
71 "]} {
72 set general [list]
73 set Og [list]
74 foreach file [lsort [glob $srcdir/c-c++-common/guality/*.c]] {
75 switch -glob -- [file tail $file] {
76 Og-* { lappend Og $file }
77 * { lappend general $file }
81 gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.C]] "" ""
82 gcc-dg-runtest $general "" ""
83 set-torture-options \
84 [list "-O0" "-Og"] \
85 [list {}] \
86 [list "-Og -flto"]
87 gcc-dg-runtest $Og "" ""
90 if [info exists guality_gdb_name] {
91 unsetenv GUALITY_GDB_NAME
94 torture-finish
95 dg-finish