From: Thomas Schwinge Date: Thu, 19 Aug 2021 13:14:51 +0000 (+0200) Subject: Add 'libgomp.c/address-space-1.c' X-Git-Tag: basepoints/gcc-13~5223 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=29c355f76ceeb4639c21acaf52c50d35c8472720;p=thirdparty%2Fgcc.git 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 --- 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 000000000000..6ad57deec42a --- /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 + +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; +}