aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c-c++-common
diff options
context:
space:
mode:
authorTobias Burnus <tobias@codesourcery.com>2020-09-28 18:08:05 +0200
committerTobias Burnus <tobias@codesourcery.com>2020-09-28 18:08:05 +0200
commit2a10a2c0689db280ee3a94164504b7196b8370f4 (patch)
treec1fe6881aa115ca2c0948a481c38c2a206eacddd /libgomp/testsuite/libgomp.c-c++-common
parent361e32eeaa8e80c2c3b4879518756cf131e8f938 (diff)
downloadgcc-2a10a2c0689db280ee3a94164504b7196b8370f4.zip
gcc-2a10a2c0689db280ee3a94164504b7196b8370f4.tar.gz
gcc-2a10a2c0689db280ee3a94164504b7196b8370f4.tar.bz2
OpenMP: Handle cpp_implicit_alias in declare-target discovery (PR96390)
gcc/ChangeLog: PR middle-end/96390 * omp-offload.c (omp_discover_declare_target_tgt_fn_r): Handle alias nodes. libgomp/ChangeLog: PR middle-end/96390 * testsuite/libgomp.c++/pr96390.C: New test. * testsuite/libgomp.c-c++-common/pr96390.c: New test.
Diffstat (limited to 'libgomp/testsuite/libgomp.c-c++-common')
-rw-r--r--libgomp/testsuite/libgomp.c-c++-common/pr96390.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.c-c++-common/pr96390.c b/libgomp/testsuite/libgomp.c-c++-common/pr96390.c
new file mode 100644
index 0000000..692bd73
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c-c++-common/pr96390.c
@@ -0,0 +1,26 @@
+/* { dg-additional-options "-O0 -fdump-tree-omplower" } */
+/* { dg-xfail-if "PR 97102/PR 97106 - .alias not (yet) supported for nvptx" { offload_target_nvptx } } */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int foo () { return 42; }
+int bar () __attribute__((alias ("foo")));
+int baz () __attribute__((alias ("bar")));
+
+#ifdef __cplusplus
+}
+#endif
+
+
+int
+main ()
+{
+ int n;
+ #pragma omp target map(from:n)
+ n = baz ();
+ if (n != 42)
+ __builtin_abort ();
+}
+/* { dg-final { scan-tree-dump-times "__attribute__..omp declare target" 1 "omplower" } } */