aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite
diff options
context:
space:
mode:
authorAlexander Monakov <amonakov@ispras.ru>2017-04-20 20:21:50 +0300
committerAlexander Monakov <amonakov@gcc.gnu.org>2017-04-20 20:21:50 +0300
commit2260d19d4be6218c0dfffe6f87fc7665a09d5ba5 (patch)
treed48f636ed59fd051513d237e7f224ac325b3b196 /libgomp/testsuite
parentc3cbcd451736f5257446e927bb880ace569f4a45 (diff)
downloadgcc-2260d19d4be6218c0dfffe6f87fc7665a09d5ba5.zip
gcc-2260d19d4be6218c0dfffe6f87fc7665a09d5ba5.tar.gz
gcc-2260d19d4be6218c0dfffe6f87fc7665a09d5ba5.tar.bz2
omp-low: fix lastprivate/linear lowering for SIMT
gcc/ * omp-low.c (lower_lastprivate_clauses): Correct handling of linear and lastprivate clauses in SIMT case. libgomp/ * testsuite/libgomp.c/target-36.c: New testcase. From-SVN: r247029
Diffstat (limited to 'libgomp/testsuite')
-rw-r--r--libgomp/testsuite/libgomp.c/target-36.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.c/target-36.c b/libgomp/testsuite/libgomp.c/target-36.c
new file mode 100644
index 0000000..6925a2a
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/target-36.c
@@ -0,0 +1,18 @@
+int
+main ()
+{
+ int ah, bh, n = 1024;
+#pragma omp target map(from: ah, bh)
+ {
+ int a, b;
+#pragma omp simd lastprivate(b)
+ for (a = 0; a < n; a++)
+ {
+ b = a + n + 1;
+ asm volatile ("" : "+r"(b));
+ }
+ ah = a, bh = b;
+ }
+ if (ah != n || bh != 2 * n)
+ __builtin_abort ();
+}