diff options
author | Thomas Schwinge <thomas@codesourcery.com> | 2021-08-19 15:14:51 +0200 |
---|---|---|
committer | Thomas Schwinge <thomas@codesourcery.com> | 2021-08-23 17:46:08 +0200 |
commit | 29c355f76ceeb4639c21acaf52c50d35c8472720 (patch) | |
tree | 8e6851efb3619bd4a22d2250cd01ec032987a32b | |
parent | bb75b22aba254e8ff144db27b1c8b4804bad73bb (diff) | |
download | gcc-29c355f76ceeb4639c21acaf52c50d35c8472720.zip gcc-29c355f76ceeb4639c21acaf52c50d35c8472720.tar.gz gcc-29c355f76ceeb4639c21acaf52c50d35c8472720.tar.bz2 |
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>
-rw-r--r-- | libgomp/testsuite/libgomp.c/address-space-1.c | 28 |
1 files changed, 28 insertions, 0 deletions
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 0000000..6ad57de --- /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; +} |