diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/gupc/addr-of-shared-bit-field.upc')
-rw-r--r-- | gcc/testsuite/gcc.dg/gupc/addr-of-shared-bit-field.upc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/gupc/addr-of-shared-bit-field.upc b/gcc/testsuite/gcc.dg/gupc/addr-of-shared-bit-field.upc new file mode 100644 index 00000000000..28d24d1ab3d --- /dev/null +++ b/gcc/testsuite/gcc.dg/gupc/addr-of-shared-bit-field.upc @@ -0,0 +1,22 @@ +/* Invalid & operation applied to a UPC shared bit field. + { dg-do compile } + { dg-options "-fupc-threads=2" } */ + +/* The base address of the UPC shared section */ +extern char __upc_shared_start[1]; + + +shared struct + { + int a; + int b : 8; + int c : 24; + } x; + +shared int *pts; + +int main (void) +{ + pts = &x.b; /* { dg-error "cannot take address of bit-field 'b'" } */ + return 0; +} |