public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-3090] Add 'libgomp.c/address-space-1.c'
@ 2021-08-23 15:46 Thomas Schwinge
  0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2021-08-23 15:46 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:29c355f76ceeb4639c21acaf52c50d35c8472720

commit r12-3090-g29c355f76ceeb4639c21acaf52c50d35c8472720
Author: Thomas Schwinge <thomas@codesourcery.com>
Date:   Thu Aug 19 15:14:51 2021 +0200

    Add 'libgomp.c/address-space-1.c'
    
    Intel MIC (emulated) offloading execution failure remains to be analyzed.
    
            libgomp/
            * testsuite/libgomp.c/address-space-1.c: New file.
    
    Co-authored-by: Jakub Jelinek <jakub@redhat.com>

Diff:
---
 libgomp/testsuite/libgomp.c/address-space-1.c | 28 +++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/libgomp/testsuite/libgomp.c/address-space-1.c b/libgomp/testsuite/libgomp.c/address-space-1.c
new file mode 100644
index 00000000000..6ad57deec42
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/address-space-1.c
@@ -0,0 +1,28 @@
+/* Verify OMP instances of variables with address space.  */
+
+/* { dg-do run { target i?86-*-* x86_64-*-* } } */
+/* { dg-require-effective-target offload_device_nonshared_as } */
+
+/* With Intel MIC (emulated) offloading:
+       offload error: process on the device 0 unexpectedly exited with code 0
+   { dg-xfail-run-if TODO { offload_device_intel_mic } } */
+
+#include <assert.h>
+
+int __seg_fs a;
+
+int
+main (void)
+{
+  // a = 123; // SIGSEGV
+  int b;
+#pragma omp target map(alloc: a) map(from: b)
+  {
+    a = 321; // no SIGSEGV (given 'offload_device_nonshared_as')
+    asm volatile ("" : : "g" (&a) : "memory");
+    b = a;
+  }
+  assert (b == 321);
+
+  return 0;
+}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-23 15:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-23 15:46 [gcc r12-3090] Add 'libgomp.c/address-space-1.c' Thomas Schwinge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).