1 # This whole file adapted from libgomp.c
/c.exp.
3 if [info exists lang_library_path
] then {
4 unset lang_library_path
7 if [info exists lang_test_file
] then {
10 if [info exists lang_include_flags
] then {
11 unset lang_include_flags
14 load_lib libgomp
-dg.exp
15 load_gcc_lib gcc
-dg.exp
16 load_gcc_lib torture
-options.exp
18 proc check_effective_target_c
{ } {
21 proc check_effective_target_c
++ { } {
30 lappend ALWAYS_CFLAGS
"additional_flags=-fopenacc"
32 # Gather a list of all tests.
33 set tests
[lsort
[concat \
34 [find $srcdir
/$subdir
*.c
] \
35 [find $srcdir
/$subdir
/..
/libgomp.oacc
-c
-c
++-common
*.c
]]]
37 set ld_library_path $always_ld_library_path
38 append ld_library_path
[gcc
-set-multilib
-library
-path $GCC_UNDER_TEST
]
39 set_ld_library_path_env_vars
41 # Test OpenACC with available accelerators.
42 set SAVE_ALWAYS_CFLAGS
"$ALWAYS_CFLAGS"
43 foreach offload_target_openacc $offload_targets_s_openacc
{
44 set ALWAYS_CFLAGS
"$SAVE_ALWAYS_CFLAGS"
45 set tagopt
"-DACC_DEVICE_TYPE_$offload_target_openacc=1"
47 switch $offload_target_openacc
{
52 if { ![check_effective_target_openacc_nvidia_accel_present
] } {
53 # Don
't bother; execution testing is going to FAIL.
54 untested "$subdir $offload_target_openacc offloading"
58 # Copy ptx file (TEMPORARY)
59 remote_download host $srcdir/libgomp.oacc-c-c++-common/subr.ptx
62 lappend ALWAYS_CFLAGS "additional_flags=-I${srcdir}/libgomp.oacc-c-c++-common"
70 set tagopt "$tagopt -DACC_MEM_SHARED=$acc_mem_shared"
72 setenv ACC_DEVICE_TYPE $offload_target_openacc
74 # To get better test coverage for device-specific code that is only
75 # ever used in offloading configurations, we'd like more thorough
76 # testing
for test cases that deal with offloading
, which most of all
77 # OpenACC test cases are. We enable torture testing
, but
limit it to
78 #
-O0 and
-O2 only
, to avoid testing times exploding too much
, under
79 # the assumption that between
-O0 and
-O
[something
] there is the
80 # biggest difference in the overall structure of the generated code.
81 switch $offload_target_openacc
{
83 set-torture
-options
[list \
87 set-torture
-options
[list \
93 gcc
-dg
-runtest $tests
"$tagopt" ""