| 1 |
load_lib libgomp-dg.exp |
| 2 |
load_gcc_lib gcc-dg.exp |
| 3 |
|
| 4 |
if { $blddir != "" } { |
| 5 |
set libstdc++_library_path "../libstdc++-v3/src/.libs" |
| 6 |
set shlib_ext [get_shlib_extension] |
| 7 |
if { ![file exists "${blddir}/${libstdc++_library_path}/libstdc++.a"] |
| 8 |
&& ![file exists "${blddir}/${libstdc++_library_path}/libstdc++.${shlib_ext}"] } { |
| 9 |
verbose -log "No libstdc++ library found, will not execute c++ tests" |
| 10 |
unset libstdc++_library_path |
| 11 |
return |
| 12 |
} |
| 13 |
lappend lang_library_paths ${libstdc++_library_path} |
| 14 |
} elseif { ![info exists GXX_UNDER_TEST] } { |
| 15 |
verbose -log "GXX_UNDER_TEST not defined, will not execute c++ tests" |
| 16 |
return |
| 17 |
} |
| 18 |
if { $blddir != "" } { |
| 19 |
set lang_source_re {^.*\.[cC]$} |
| 20 |
set lang_include_flags [exec sh ${blddir}/../libstdc++-v3/scripts/testsuite_flags --build-includes] |
| 21 |
} |
| 22 |
lappend ALWAYS_CFLAGS "compiler=$GXX_UNDER_TEST" |
| 23 |
|
| 24 |
# If a testcase doesn't have special options, use these. |
| 25 |
if ![info exists DEFAULT_CFLAGS] then { |
| 26 |
set DEFAULT_CFLAGS "-O2" |
| 27 |
} |
| 28 |
|
| 29 |
# Initialize dg. |
| 30 |
dg-init |
| 31 |
|
| 32 |
# Turn on OpenMP. |
| 33 |
lappend ALWAYS_CFLAGS "additional_flags=-fopenmp" |
| 34 |
|
| 35 |
# Gather a list of all tests. |
| 36 |
set tests [lsort [concat \ |
| 37 |
[find $srcdir/$subdir *.C] \ |
| 38 |
[find $srcdir/$subdir/../libgomp.c-c++-common *.c]]] |
| 39 |
|
| 40 |
set ld_library_path $always_ld_library_path |
| 41 |
if { $blddir != "" } { |
| 42 |
append ld_library_path ":${blddir}/${libstdc++_library_path}" |
| 43 |
} |
| 44 |
append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST] |
| 45 |
set_ld_library_path_env_vars |
| 46 |
|
| 47 |
# Main loop. |
| 48 |
dg-runtest $tests "" $DEFAULT_CFLAGS |
| 49 |
|
| 50 |
if { $blddir != "" } { |
| 51 |
unset lang_source_re |
| 52 |
unset lang_include_flags |
| 53 |
unset libstdc++_library_path |
| 54 |
unset lang_library_paths |
| 55 |
} |
| 56 |
|
| 57 |
# All done. |
| 58 |
dg-finish |