From 82419efbbfcf537f890b9095fdccc1ac44b9ef34 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 14 Sep 2017 21:15:40 +0000 Subject: [PATCH] Introduce libgomp/testsuite/libgomp.c-c++-common 2017-09-14 Tom de Vries * testsuite/libgomp.c++/cancel-taskgroup-1.C: Remove. * testsuite/libgomp.c/cancel-taskgroup-1.c: Move to ... * testsuite/libgomp.c-c++-common/cancel-taskgroup-1.c: ... here. * testsuite/libgomp.c/c.exp: Include test-cases from libgomp.c-c++-common. * testsuite/libgomp.c++/c++.exp: Same. Force c++-mode compilation of .c files. From-SVN: r252775 --- libgomp/ChangeLog | 10 ++++++++++ libgomp/testsuite/libgomp.c++/c++.exp | 12 +++++++++++- libgomp/testsuite/libgomp.c++/cancel-taskgroup-1.C | 4 ---- .../cancel-taskgroup-1.c | 0 libgomp/testsuite/libgomp.c/c.exp | 4 +++- 5 files changed, 24 insertions(+), 6 deletions(-) delete mode 100644 libgomp/testsuite/libgomp.c++/cancel-taskgroup-1.C rename libgomp/testsuite/{libgomp.c => libgomp.c-c++-common}/cancel-taskgroup-1.c (100%) diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 459dcffa570..9fafd622b60 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,13 @@ +2017-09-14 Tom de Vries + + * testsuite/libgomp.c++/cancel-taskgroup-1.C: Remove. + * testsuite/libgomp.c/cancel-taskgroup-1.c: Move to ... + * testsuite/libgomp.c-c++-common/cancel-taskgroup-1.c: ... here. + * testsuite/libgomp.c/c.exp: Include test-cases from + libgomp.c-c++-common. + * testsuite/libgomp.c++/c++.exp: Same. Force c++-mode compilation of .c + files. + 2017-09-14 Jakub Jelinek PR c++/81314 diff --git a/libgomp/testsuite/libgomp.c++/c++.exp b/libgomp/testsuite/libgomp.c++/c++.exp index 0454f95588e..f4884e2ffa7 100644 --- a/libgomp/testsuite/libgomp.c++/c++.exp +++ b/libgomp/testsuite/libgomp.c++/c++.exp @@ -22,6 +22,11 @@ dg-init # Turn on OpenMP. lappend ALWAYS_CFLAGS "additional_flags=-fopenmp" +# Switch into C++ mode. Otherwise, the libgomp.c-c++-common/*.c +# files would be compiled as C files. +set SAVE_GCC_UNDER_TEST "$GCC_UNDER_TEST" +set GCC_UNDER_TEST "$GCC_UNDER_TEST -x c++" + set blddir [lookfor_file [get_multilibs] libgomp] @@ -47,7 +52,9 @@ if { $blddir != "" } { if { $lang_test_file_found } { # Gather a list of all tests. - set tests [lsort [find $srcdir/$subdir *.C]] + set tests [lsort [concat \ + [find $srcdir/$subdir *.C] \ + [find $srcdir/$subdir/../libgomp.c-c++-common *.c]]] if { $blddir != "" } { set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}" @@ -68,5 +75,8 @@ if { $lang_test_file_found } { dg-runtest $tests "" "$libstdcxx_includes $DEFAULT_CFLAGS" } +# See above. +set GCC_UNDER_TEST "$SAVE_GCC_UNDER_TEST" + # All done. dg-finish diff --git a/libgomp/testsuite/libgomp.c++/cancel-taskgroup-1.C b/libgomp/testsuite/libgomp.c++/cancel-taskgroup-1.C deleted file mode 100644 index 4f66859d171..00000000000 --- a/libgomp/testsuite/libgomp.c++/cancel-taskgroup-1.C +++ /dev/null @@ -1,4 +0,0 @@ -// { dg-do run } -// { dg-set-target-env-var OMP_CANCELLATION "true" } - -#include "../libgomp.c/cancel-taskgroup-1.c" diff --git a/libgomp/testsuite/libgomp.c/cancel-taskgroup-1.c b/libgomp/testsuite/libgomp.c-c++-common/cancel-taskgroup-1.c similarity index 100% rename from libgomp/testsuite/libgomp.c/cancel-taskgroup-1.c rename to libgomp/testsuite/libgomp.c-c++-common/cancel-taskgroup-1.c diff --git a/libgomp/testsuite/libgomp.c/c.exp b/libgomp/testsuite/libgomp.c/c.exp index 300b9211f6d..31bdd5795dc 100644 --- a/libgomp/testsuite/libgomp.c/c.exp +++ b/libgomp/testsuite/libgomp.c/c.exp @@ -24,7 +24,9 @@ dg-init lappend ALWAYS_CFLAGS "additional_flags=-fopenmp" # Gather a list of all tests. -set tests [lsort [find $srcdir/$subdir *.c]] +set tests [lsort [concat \ + [find $srcdir/$subdir *.c] \ + [find $srcdir/$subdir/../libgomp.c-c++-common *.c]]] set ld_library_path $always_ld_library_path append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST] -- 2.30.2