summaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c++/c++.exp
blob: ed096e17b9c599c8d4185b3ba227bbd3ca239322 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
load_lib libgomp-dg.exp
load_gcc_lib gcc-dg.exp

if { $blddir != "" } {
    set libstdc++_library_path "../libstdc++-v3/src/.libs"
    set shlib_ext [get_shlib_extension]
    if { ![file exists "${blddir}/${libstdc++_library_path}/libstdc++.a"]
	 && ![file exists "${blddir}/${libstdc++_library_path}/libstdc++.${shlib_ext}"] } {
	verbose -log "No libstdc++ library found, will not execute c++ tests"
	unset libstdc++_library_path
	return
    }
    lappend lang_library_paths ${libstdc++_library_path}
} elseif { ![info exists GXX_UNDER_TEST] } {
    verbose -log "GXX_UNDER_TEST not defined, will not execute c++ tests"
    return
}
if { $blddir != "" } {
    set lang_source_re {^.*\.[cC]$}
    set lang_include_flags [exec sh ${blddir}/../libstdc++-v3/scripts/testsuite_flags --build-includes]
}
lappend ALWAYS_CFLAGS "compiler=$GXX_UNDER_TEST"

# If a testcase doesn't have special options, use these.
if ![info exists DEFAULT_CFLAGS] then {
    set DEFAULT_CFLAGS "-O2"
}

# Initialize dg.
dg-init

# Turn on OpenMP.
lappend ALWAYS_CFLAGS "additional_flags=-fopenmp"

# Gather a list of all tests.
set tests [lsort [concat \
		      [find $srcdir/$subdir *.C] \
		      [find $srcdir/$subdir/../libgomp.c-c++-common *.c]]]

set ld_library_path $always_ld_library_path
if { $blddir != "" } {
    append ld_library_path ":${blddir}/${libstdc++_library_path}"
}
append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
set_ld_library_path_env_vars

# Main loop.
dg-runtest $tests "" $DEFAULT_CFLAGS

if { $blddir != "" } {
    unset lang_source_re
    unset lang_include_flags
    unset libstdc++_library_path
    unset lang_library_paths
}

# All done.
dg-finish