gcc/libgomp/testsuite/libgomp.c/address-space-1.c
Thomas Schwinge 9fcc3a1dd2 Host and offload targets have no common meaning of address spaces
gcc/
	* tree-streamer-out.c (pack_ts_base_value_fields): Don't pack
	'TYPE_ADDR_SPACE' for offloading.
	* tree-streamer-in.c (unpack_ts_base_value_fields): Don't unpack
	'TYPE_ADDR_SPACE' for offloading.
	libgomp/
	* testsuite/libgomp.c/address-space-1.c: Remove 'dg-xfail-run-if'
	for 'offload_device_intel_mic'.
2022-01-13 11:16:20 +01:00

25 lines
483 B
C

/* Verify OMP instances of variables with address space. */
/* { dg-do run { target i?86-*-* x86_64-*-* } } */
/* { dg-require-effective-target offload_device_nonshared_as } */
#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;
}