diff mbox

[UPC,21/22] gcc.dg test suite

Message ID 20151201060242.GA31385@intrepid.com
State New
Headers show

Commit Message

Gary Funck Dec. 1, 2015, 6:02 a.m. UTC
Background
----------

An overview email, describing the UPC-related changes is here:
  https://gcc.gnu.org/ml/gcc-patches/2015-12/msg00005.html

The GUPC branch is described here:
  http://gcc.gnu.org/projects/gupc.html

The UPC-related source code differences are summarized here:
  http://gccupc.org/gupc-changes

All languages (c, c++, fortran, go, lto, objc, obj-c++) have been
bootstrapped; no test suite regressions were introduced,
relative to the GCC trunk.

If you are on the cc-list, your name was chosen either
because you are listed as a maintainer for the area that
applies to the patches described in this email, or you
were a frequent contributor of patches made to files listed
in this email.

In the change log entries included in each patch, the directory
containing the affected files is listed, followed by the files.
When the patches are applied, the change log entries will be
distributed to the appropriate ChangeLog file.

Overview
--------

The test suite additions under gcc/testsuite/gcc.dg/gupc
test most of the "negative" front-end errors generated by GNU UPC.
These are compile-only tests and can be safely run as part of
the gcc.dg test suite.

There are also some tests which test code generation for 'gets'
and 'puts' to UPC shared memory.  These code generation tests
scan the '.original' tree dump for expected UPC runtime calls.

A new gupc.exp file is introduced under gcc/testsuite/gcc.dg/gupc.
It checks that the compiler supports the -fupc switch; if not then
tests will not be run.  gupc.exp sets the compilation flags
to -fno-upc-pre-include by default.  This removes any dependency upon
the libgupc runtime library, but requires that the tests declare
various runtime API's and variables exported by the UPC runtime library
that would have otherwise been declared in the gcc-upc.h file built
under libgupc/include.

2015-11-30  Gary Funck  <gary@intrepid.com>

	gcc/testsuite/gcc.dg/gupc/
	* addr-of-shared-bit-field.upc: New.
	* assign-local-ptr-to-pts.upc: New.
	* assign-pts-to-local-ptr.upc: New.
	* assign-pts-with-diff-block-factors-no-cast.upc: New.
	* barrier-notify-wait.upc: New.
	* block-factor-applied-to-void-type.upc: New.
	* block-factor-incompatible-with-ref-type.upc: New.
	* block-factor-not-int-constant.upc: New.
	* cast-int-to-pts.upc: New.
	* cast-local-ptr-to-pts.upc: New.
	* cmp-pts-and-local-ptr.upc: New.
	* cmp-pts-eq-diff-block-factor-1.upc: New.
	* cmp-pts-eq-diff-block-factor-2.upc: New.
	* cmp-pts-eq-diff-block-factor-3.upc: New.
	* cmp-pts-gt-diff-block-factor-1.upc: New.
	* cmp-pts-gt-diff-block-factor-2.upc: New.
	* cmp-pts-gt-diff-block-factor-3.upc: New.
	* decl-multiple-layout-quals.upc: New.
	* deprecated-barrier-notify-stmt.upc: New.
	* deprecated-barrier-stmt.upc: New.
	* deprecated-barrier-wait-stmt.upc: New.
	* diff-pts-and-local-ptr.upc: New.
	* dyn-array-decl-threads-more-than-once.upc: New.
	* dyn-array-dim-not-simple-multiple-of-threads.upc: New.
	* dyn-star-layout-dim-not-multiple-of-threads.upc: New.
	* dyn-threads-more-than-once.upc: New.
	* dyn-threads-with-indef-block-size.upc: New.
	* field-decl-with-shared-qual.upc: New.
	* func-decl-has-shared_qual.upc: New.
	* get-blk-relaxed.upc: New.
	* get-blk-strict.upc: New.
	* get-df-relaxed.upc: New.
	* get-df-strict.upc: New.
	* get-di-relaxed.upc: New.
	* get-di-strict.upc: New.
	* get-hi-relaxed.upc: New.
	* get-hi-strict.upc: New.
	* get-qi-relaxed.upc: New.
	* get-qi-strict.upc: New.
	* get-sf-relaxed.upc: New.
	* get-sf-strict.upc: New.
	* get-si-relaxed.upc: New.
	* get-si-strict.upc: New.
	* get-tf-relaxed.upc: New.
	* get-tf-strict.upc: New.
	* get-ti-relaxed.upc: New.
	* get-ti-strict.upc: New.
	* getaddr.upc: New.
	* gupc.exp: New.  Compile all *.upc tests in this directory.
	* init-makes-pts-from-int.upc: New.
	* invalid-local-ptr-to-void-arith.upc: New.
	* invalid-sizeof-shared-void.upc: New.
	* invalid-sizeof-void.upc: New.
	* lt-pts-and-local-ptr.upc: New.
	* max-block-size-exceeded.upc: New.
	* no-closing-layout-qual-bracket.upc: New.
	* parm-decl-with-shared-qual.upc: New.
	* passing-arg-makes-pts-from-int.upc: New.
	* pts-to-void-in-arith.upc: New.
	* put-blk-relaxed.upc: New.
	* put-blk-strict.upc: New.
	* put-df-relaxed.upc: New.
	* put-df-strict.upc: New.
	* put-di-relaxed.upc: New.
	* put-di-strict.upc: New.
	* put-hi-relaxed.upc: New.
	* put-hi-strict.upc: New.
	* put-qi-relaxed.upc: New.
	* put-qi-strict.upc: New.
	* put-sf-relaxed.upc: New.
	* put-sf-strict.upc: New.
	* put-si-relaxed.upc: New.
	* put-si-strict.upc: New.
	* put-tf-relaxed.upc: New.
	* put-tf-strict.upc: New.
	* put-ti-relaxed.upc: New.
	* put-ti-strict.upc: New.
	* relaxed-qual-but-not-shared.upc: New.
	* return-makes-pts-from-int.upc: New.
	* shared-array-init-unsupported.upc: New.
	* shared-auto-var-decl.upc: New.
	* shared-init-addr.upc: New.
	* shared-var-both-strict-and-relaxed.upc: New.
	* shared-vla-not-allowed.upc: New.
	* star-block-factor-applied-to-incomplete-type.upc: New.
	* star-block-factor-in-pts-decl.upc: New.
	* static-threads-val-too-big.upc: New.
	* strict-qual-but-not-shared.upc: New.
	* upc-blocksizeof-func-type.upc: New.
	* upc-blocksizeof-non-shared-type.upc: New.
	* upc-blocksizeof-void-type.upc: New.
	* upc-elemsizeof-func-type.upc: New.
	* upc-elemsizeof-non-shared-type.upc: New.
	* upc-elemsizeof-void-type.upc: New.
	* upc-localsizeof-func-type.upc: New.
	* upc-localsizeof-non-shared-type.upc: New.
	* upc-localsizeof-void-type.upc: New.
	* warn-junk-at-end-pragma-upc.upc: New.
	* warn-missing-param-after-pragma-upc.upc: New.
	* warn-pragma-upc-bad-context.upc: New.
	gcc/testsuite/lib/
	* target-supports.exp (check_effective_target_fupc):  New.
	Return 1 if compilation with -fupc is error-free.
diff mbox

Patch

Index: gcc/testsuite/gcc.dg/gupc/addr-of-shared-bit-field.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/addr-of-shared-bit-field.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/addr-of-shared-bit-field.upc	(.../branches/gupc)	(revision 231080)
@@ -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;
+}
Index: gcc/testsuite/gcc.dg/gupc/assign-local-ptr-to-pts.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/assign-local-ptr-to-pts.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/assign-local-ptr-to-pts.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,20 @@ 
+/* UPC does not allow assignments from a local pointer
+   to a pointer-to-shared.
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+int x;
+
+shared int *pts;
+
+int main (void)
+{
+  int *local_ptr = &x;
+  pts = local_ptr; /* { dg-error "UPC does not allow assignments from a local pointer to a pointer-to-shared" } */
+  return 0;
+}
Index: gcc/testsuite/gcc.dg/gupc/assign-pts-to-local-ptr.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/assign-pts-to-local-ptr.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/assign-pts-to-local-ptr.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,18 @@ 
+/* UPC does not allow assignments
+   from a pointer-to-shared to a local pointer.
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+shared int *pts;
+
+int main (void)
+{
+  int *local_ptr = pts; /* { dg-error "UPC does not allow assignments from a pointer-to-shared to a local pointer" } */
+  *local_ptr = 1;
+  return 0;
+}
Index: gcc/testsuite/gcc.dg/gupc/assign-pts-with-diff-block-factors-no-cast.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/assign-pts-with-diff-block-factors-no-cast.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/assign-pts-with-diff-block-factors-no-cast.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,22 @@ 
+/* UPC does not allow assignment
+   between pointers to shared with
+   differing block sizes without a cast.
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+shared [3] int A3[3*THREADS];
+shared [5] int A5[5*THREADS];
+
+shared [3] int *p3 = A3;
+shared [5] int *p5 = A5;
+
+int main (void)
+{
+  p3 = p5; /* { dg-error "UPC does not allow assignment between pointers to shared with differing block sizes without a cast" } */
+  return 0;
+}
Index: gcc/testsuite/gcc.dg/gupc/barrier-notify-wait.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/barrier-notify-wait.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/barrier-notify-wait.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,17 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+/* Runtime API */
+extern void __upc_barrier (int);
+extern void __upc_notify (int);
+extern void __upc_wait (int);
+
+int main () {
+  /* { dg-final { scan-tree-dump-times "__upc_barrier \\\(123\\\)" 1 "original" } } */
+  upc_barrier 123;
+  /* { dg-final { scan-tree-dump-times "__upc_notify \\\(456\\\)" 1 "original" } } */
+  upc_notify 456;
+  /* { dg-final { scan-tree-dump-times "__upc_wait \\\(456\\\)" 1 "original" } } */
+  upc_wait 456;
+  return 0;
+}
Index: gcc/testsuite/gcc.dg/gupc/block-factor-applied-to-void-type.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/block-factor-applied-to-void-type.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/block-factor-applied-to-void-type.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,10 @@ 
+/* UPC layout qualifier cannot be applied to a void type.  
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+shared [5] void *pts; /* { dg-error "UPC layout qualifier cannot be applied to a void type" } */
Index: gcc/testsuite/gcc.dg/gupc/block-factor-incompatible-with-ref-type.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/block-factor-incompatible-with-ref-type.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/block-factor-incompatible-with-ref-type.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,12 @@ 
+/* UPC layout qualifier is incompatible with the referenced type.  
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+typedef shared [3] int array_blocked_3_type[30];
+
+shared [5] array_blocked_3_type A[THREADS]; /* { dg-error "UPC layout qualifier is incompatible with the referenced type" } */
Index: gcc/testsuite/gcc.dg/gupc/block-factor-not-int-constant.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/block-factor-not-int-constant.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/block-factor-not-int-constant.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,10 @@ 
+/* UPC layout qualifier is not an integral constant.  
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+shared [0.5] int A[10*THREADS]; /* { dg-error "UPC layout qualifier is not an integral constant" } */
Index: gcc/testsuite/gcc.dg/gupc/cast-int-to-pts.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/cast-int-to-pts.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/cast-int-to-pts.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,16 @@ 
+/* UPC does not allow casts from an integer to a pointer-to-shared.  
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+extern void __putsi2 (upc_shared_ptr_t, int);
+
+
+
+int main (void)
+{
+  shared int *pts = (shared int *)0x400; /* { dg-error "UPC does not allow casts from an integer to a pointer-to-shared" } */
+  *pts = 1;
+  return 0;
+}
Index: gcc/testsuite/gcc.dg/gupc/cast-local-ptr-to-pts.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/cast-local-ptr-to-pts.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/cast-local-ptr-to-pts.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,19 @@ 
+/* UPC does not allow casts from a local pointer to a pointer-to-shared.  
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+extern void __putsi2 (upc_shared_ptr_t, int);
+
+
+
+int x;
+
+int main (void)
+{
+  int *local_ptr = &x;
+  shared int *pts = (shared int *)local_ptr; /* { dg-error "UPC does not allow casts from a local pointer to a pointer-to-shared" } */
+  *pts = 1;
+  return 0;
+}
Index: gcc/testsuite/gcc.dg/gupc/cmp-pts-and-local-ptr.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/cmp-pts-and-local-ptr.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/cmp-pts-and-local-ptr.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,22 @@ 
+/* UPC does not allow comparisons between pointers to shared and
+   local pointers.
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+int x;
+shared int v;
+
+shared int *pts;
+int *local_ptr;
+
+int main (void)
+{
+  local_ptr = &x;
+  pts = &v;
+  return pts == local_ptr; /* { dg-error "UPC does not allow comparisons between pointers to shared and local pointers" } */
+}
Index: gcc/testsuite/gcc.dg/gupc/cmp-pts-eq-diff-block-factor-1.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/cmp-pts-eq-diff-block-factor-1.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/cmp-pts-eq-diff-block-factor-1.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,16 @@ 
+/* 	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+shared [10] int *p10;
+
+shared [20] int *p20;
+
+int
+main ()
+{
+  return p10 == p20; /* { dg-error "UPC does not allow comparison between pointers to shared with differing block sizes without a cast" } */
+}
Index: gcc/testsuite/gcc.dg/gupc/cmp-pts-eq-diff-block-factor-2.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/cmp-pts-eq-diff-block-factor-2.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/cmp-pts-eq-diff-block-factor-2.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,16 @@ 
+/* 	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+shared int *p1;
+
+shared [20] int *p20;
+
+int
+main ()
+{
+  return p1 == p20; /* { dg-error "UPC does not allow comparison between pointers to shared with differing block sizes without a cast" } */
+}
Index: gcc/testsuite/gcc.dg/gupc/cmp-pts-eq-diff-block-factor-3.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/cmp-pts-eq-diff-block-factor-3.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/cmp-pts-eq-diff-block-factor-3.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,16 @@ 
+/* 	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+shared [] int *p0;
+
+shared int *p1;
+
+int
+main ()
+{
+  return p0 == p1; /* { dg-error "UPC does not allow comparison between pointers to shared with differing block sizes without a cast" } */
+}
Index: gcc/testsuite/gcc.dg/gupc/cmp-pts-gt-diff-block-factor-1.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/cmp-pts-gt-diff-block-factor-1.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/cmp-pts-gt-diff-block-factor-1.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,16 @@ 
+/* 	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+shared [10] int *p10;
+
+shared [20] int *p20;
+
+int
+main ()
+{
+  return p10 > p20; /* { dg-error "UPC does not allow comparison between pointers to shared with differing block sizes without a cast" } */
+}
Index: gcc/testsuite/gcc.dg/gupc/cmp-pts-gt-diff-block-factor-2.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/cmp-pts-gt-diff-block-factor-2.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/cmp-pts-gt-diff-block-factor-2.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,16 @@ 
+/* 	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+shared int *p1;
+
+shared [20] int *p20;
+
+int
+main ()
+{
+  return p1 > p20; /* { dg-error "UPC does not allow comparison between pointers to shared with differing block sizes without a cast" } */
+}
Index: gcc/testsuite/gcc.dg/gupc/cmp-pts-gt-diff-block-factor-3.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/cmp-pts-gt-diff-block-factor-3.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/cmp-pts-gt-diff-block-factor-3.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,16 @@ 
+/* 	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+shared [] int *p0;
+
+shared int *p1;
+
+int
+main ()
+{
+  return p0 > p1; /* { dg-error "UPC does not allow comparison between pointers to shared with differing block sizes without a cast" } */
+}
Index: gcc/testsuite/gcc.dg/gupc/decl-multiple-layout-quals.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/decl-multiple-layout-quals.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/decl-multiple-layout-quals.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,10 @@ 
+/* Two or more layout qualifiers specified.  
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+shared [10] shared [20] int x[200*THREADS]; /* { dg-error "two or more layout qualifiers specified" } */
Index: gcc/testsuite/gcc.dg/gupc/deprecated-barrier-notify-stmt.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/deprecated-barrier-notify-stmt.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/deprecated-barrier-notify-stmt.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,15 @@ 
+/* ‘barrier_notify’ was supported in version 1.0 of the UPC specification,
+    it has been deprecated, use ‘upc_notify’ instead.
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+int main()
+{
+   barrier_notify; /* { dg-error "'barrier_notify' was supported in version 1.0 of the UPC specification, it has been deprecated, use 'upc_notify' instead" } */
+   return 0;
+}
Index: gcc/testsuite/gcc.dg/gupc/deprecated-barrier-stmt.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/deprecated-barrier-stmt.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/deprecated-barrier-stmt.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,15 @@ 
+/* ‘barrier’ was supported in version 1.0 of the UPC specification,
+    it has been deprecated, use ‘upc_barrier’ instead.
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+int main()
+{
+   barrier; /* { dg-error "'barrier' was supported in version 1.0 of the UPC specification, it has been deprecated, use 'upc_barrier' instead" } */
+   return 0;
+}
Index: gcc/testsuite/gcc.dg/gupc/deprecated-barrier-wait-stmt.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/deprecated-barrier-wait-stmt.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/deprecated-barrier-wait-stmt.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,15 @@ 
+/* ‘barrier_wait’ was supported in version 1.0 of the UPC specification,
+    it has been deprecated, use ‘upc_wait’ instead.
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+int main()
+{
+   barrier_wait; /* { dg-error "'barrier_wait' was supported in version 1.0 of the UPC specification, it has been deprecated, use 'upc_wait' instead" } */
+   return 0;
+}
Index: gcc/testsuite/gcc.dg/gupc/diff-pts-and-local-ptr.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/diff-pts-and-local-ptr.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/diff-pts-and-local-ptr.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,24 @@ 
+/* Attempt to take the difference of a UPC pointer-to-shared
+   and a local pointer.
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+int x;
+shared int v;
+
+shared int *pts;
+int *local_ptr;
+int diff;
+
+int main (void)
+{
+  local_ptr = &x;
+  pts = &v;
+  diff = (pts - local_ptr); /* { dg-error "attempt to take the difference of a UPC pointer-to-shared and a local pointer" } */
+  return 0;
+}
Index: gcc/testsuite/gcc.dg/gupc/dyn-array-decl-threads-more-than-once.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/dyn-array-decl-threads-more-than-once.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/dyn-array-decl-threads-more-than-once.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,12 @@ 
+/* UPC shared array declaration references THREADS
+   more than once; the size cannot be calculated.
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=0" } */
+
+extern int THREADS;
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+shared int A[THREADS][THREADS]; /* { dg-error "UPC shared array declaration references THREADS more than once; the size of 'A' cannot be calculated" } */
Index: gcc/testsuite/gcc.dg/gupc/dyn-array-dim-not-simple-multiple-of-threads.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/dyn-array-dim-not-simple-multiple-of-threads.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/dyn-array-dim-not-simple-multiple-of-threads.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,12 @@ 
+/* UPC shared array dimension is not a simple multiple 
+   of THREADS; the size cannot be calculated.
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=0" } */
+
+extern int THREADS;
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+shared int A[10*THREADS + 1]; /* { dg-error "UPC shared array dimension is not a simple multiple of THREADS; the size of 'A' cannot be calculated." } */
Index: gcc/testsuite/gcc.dg/gupc/dyn-star-layout-dim-not-multiple-of-threads.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/dyn-star-layout-dim-not-multiple-of-threads.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/dyn-star-layout-dim-not-multiple-of-threads.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,14 @@ 
+/* A UPC layout qualifier of '[*]' requires that
+   the array size is either an integral constant
+   or an integral multiple of THREADS.
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=0" } */
+
+extern int THREADS;
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+shared [*] int A[THREADS+1]; /* { dg-error "UPC shared array dimension is not a simple multiple of THREADS; the size of 'A' cannot be calculated." } */
+/* { dg-prune-output "a UPC layout qualifier of '\\\[\\*\\\]' requires that the array size is either an integral constant or an integral multiple of THREADS" } */
Index: gcc/testsuite/gcc.dg/gupc/dyn-threads-more-than-once.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/dyn-threads-more-than-once.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/dyn-threads-more-than-once.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,14 @@ 
+/* In the UPC dynamic translation environment,
+   THREADS must appear exactly once in 
+   declarations of shared arrays; 
+   the storage size cannot be calculated.
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=0" } */
+
+extern int THREADS;
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+shared int A[THREADS*THREADS]; /* { dg-error "UPC shared array declaration references THREADS more than once; the size of 'A' cannot be calculated" } */
Index: gcc/testsuite/gcc.dg/gupc/dyn-threads-with-indef-block-size.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/dyn-threads-with-indef-block-size.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/dyn-threads-with-indef-block-size.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,13 @@ 
+/* In the UPC dynamic translation environment,
+   THREADS may not appear in declarations
+   of shared arrays with indefinite block size;
+   the storage size cannot be calculated.
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=0" } */
+
+extern int THREADS;
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+shared [] int A[THREADS]; /* { dg-error "in the UPC dynamic translation environment, THREADS may not appear in declarations of shared arrays with indefinite block size; the storage size of 'A' cannot be calculated" } */
Index: gcc/testsuite/gcc.dg/gupc/field-decl-with-shared-qual.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/field-decl-with-shared-qual.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/field-decl-with-shared-qual.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,15 @@ 
+/* Field declared with UPC shared qualifier.  
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+struct S_struct
+  {
+    int field1;
+    shared double field2; /* { dg-error "field 'field2' declared with UPC shared qualifier" } */
+    char field3;
+  };
Index: gcc/testsuite/gcc.dg/gupc/func-decl-has-shared_qual.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/func-decl-has-shared_qual.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/func-decl-has-shared_qual.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,13 @@ 
+/* Function definition has UPC shared qualified return type. 
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+shared int return_shared_int (void) /* { dg-error "function definition has UPC shared qualified return type" } */
+{
+  return 0;
+}
Index: gcc/testsuite/gcc.dg/gupc/get-blk-relaxed.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/get-blk-relaxed.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/get-blk-relaxed.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,21 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+typedef struct { unsigned char c[16]; } blk_t;
+
+/* UPC runtime remote access prototype */
+typedef __SIZE_TYPE__ size_t;
+extern blk_t __getblk3 (void *, upc_shared_ptr_t, size_t);
+
+relaxed shared blk_t x;
+blk_t local_x;
+
+void p () {
+  local_x = x;
+}
+
+/* { dg-final { scan-tree-dump-times "getblk3" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/get-blk-strict.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/get-blk-strict.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/get-blk-strict.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,21 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+typedef struct { unsigned char c[16]; } blk_t;
+
+/* UPC runtime remote access prototype */
+typedef __SIZE_TYPE__ size_t;
+extern blk_t __getsblk3 (void *, upc_shared_ptr_t, size_t);
+
+strict shared blk_t x;
+blk_t local_x;
+
+void p () {
+  local_x = x;
+}
+
+/* { dg-final { scan-tree-dump-times "getsblk3" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/get-df-relaxed.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/get-df-relaxed.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/get-df-relaxed.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,18 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+/* UPC runtime remote access prototype */
+extern double __getdf2 (upc_shared_ptr_t);
+
+relaxed shared double x;
+
+double p () {
+  return x;
+}
+
+/* { dg-final { scan-tree-dump-times "getdf2" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/get-df-strict.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/get-df-strict.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/get-df-strict.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,18 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+/* UPC runtime remote access prototype */
+extern double __getsdf2 (upc_shared_ptr_t);
+
+strict shared double x;
+
+double p () {
+  return x;
+}
+
+/* { dg-final { scan-tree-dump-times "getsdf2" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/get-di-relaxed.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/get-di-relaxed.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/get-di-relaxed.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,19 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+typedef unsigned int uint_di_t __attribute__ ((__mode__(__DI__)));
+
+/* UPC runtime remote access prototype */
+extern uint_di_t __getdi2 (upc_shared_ptr_t);
+
+relaxed shared uint_di_t x;
+
+uint_di_t p () {
+  return x;
+}
+
+/* { dg-final { scan-tree-dump-times "getdi2" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/get-di-strict.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/get-di-strict.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/get-di-strict.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,19 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+typedef unsigned int uint_di_t __attribute__ ((__mode__(__DI__)));
+
+/* UPC runtime remote access prototype */
+extern uint_di_t __getsdi2 (upc_shared_ptr_t);
+
+strict shared uint_di_t x;
+
+uint_di_t p () {
+  return x;
+}
+
+/* { dg-final { scan-tree-dump-times "getsdi2" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/get-hi-relaxed.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/get-hi-relaxed.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/get-hi-relaxed.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,19 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+typedef unsigned int uint_hi_t __attribute__ ((__mode__(__HI__)));
+
+/* UPC runtime remote access prototype */
+extern uint_hi_t __gethi2 (upc_shared_ptr_t);
+
+relaxed shared uint_hi_t x;
+
+uint_hi_t p () {
+  return x;
+}
+
+/* { dg-final { scan-tree-dump-times "gethi2" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/get-hi-strict.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/get-hi-strict.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/get-hi-strict.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,19 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+typedef unsigned int uint_hi_t __attribute__ ((__mode__(__HI__)));
+
+/* UPC runtime remote access prototype */
+extern uint_hi_t __getshi2 (upc_shared_ptr_t);
+
+strict shared uint_hi_t x;
+
+uint_hi_t p () {
+  return x;
+}
+
+/* { dg-final { scan-tree-dump-times "getshi2" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/get-qi-relaxed.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/get-qi-relaxed.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/get-qi-relaxed.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,19 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+typedef unsigned int uint_qi_t __attribute__ ((__mode__(__QI__)));
+
+/* UPC runtime remote access prototype */
+extern uint_qi_t __getqi2 (upc_shared_ptr_t);
+
+relaxed shared uint_qi_t x;
+
+uint_qi_t p () {
+  return x;
+}
+
+/* { dg-final { scan-tree-dump-times "getqi2" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/get-qi-strict.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/get-qi-strict.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/get-qi-strict.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,19 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+typedef unsigned int uint_qi_t __attribute__ ((__mode__(__QI__)));
+
+/* UPC runtime remote access prototype */
+extern uint_qi_t __getsqi2 (upc_shared_ptr_t);
+
+strict shared uint_qi_t x;
+
+uint_qi_t p () {
+  return x;
+}
+
+/* { dg-final { scan-tree-dump-times "getsqi2" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/get-sf-relaxed.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/get-sf-relaxed.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/get-sf-relaxed.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,18 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+/* UPC runtime remote access prototype */
+extern float __getsf2 (upc_shared_ptr_t);
+
+relaxed shared float x;
+
+float p () {
+  return x;
+}
+
+/* { dg-final { scan-tree-dump-times "getsf2" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/get-sf-strict.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/get-sf-strict.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/get-sf-strict.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,18 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+/* UPC runtime remote access prototype */
+extern float __getssf2 (upc_shared_ptr_t);
+
+strict shared float x;
+
+float p () {
+  return x;
+}
+
+/* { dg-final { scan-tree-dump-times "getssf2" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/get-si-relaxed.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/get-si-relaxed.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/get-si-relaxed.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,19 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+typedef unsigned int uint_si_t __attribute__ ((__mode__(__SI__)));
+
+/* UPC runtime remote access prototype */
+extern uint_si_t __getsi2 (upc_shared_ptr_t);
+
+relaxed shared uint_si_t x;
+
+uint_si_t p () {
+  return x;
+}
+
+/* { dg-final { scan-tree-dump-times "getsi2" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/get-si-strict.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/get-si-strict.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/get-si-strict.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,19 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+typedef unsigned int uint_si_t __attribute__ ((__mode__(__SI__)));
+
+/* UPC runtime remote access prototype */
+extern uint_si_t __getssi2 (upc_shared_ptr_t);
+
+strict shared uint_si_t x;
+
+uint_si_t p () {
+  return x;
+}
+
+/* { dg-final { scan-tree-dump-times "getssi2" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/get-tf-relaxed.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/get-tf-relaxed.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/get-tf-relaxed.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,20 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+/* { dg-require-effective-target longdouble128 } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+/* UPC runtime remote access prototype */
+extern long double __gettf2 (upc_shared_ptr_t);
+extern long double __getxf2 (upc_shared_ptr_t);
+
+relaxed shared long double x;
+
+long double p () {
+  return x;
+}
+
+/* { dg-final { scan-tree-dump-times "get\[tx\]f2" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/get-tf-strict.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/get-tf-strict.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/get-tf-strict.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,20 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+/* { dg-require-effective-target longdouble128 } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+/* UPC runtime remote access prototype */
+extern long double __getstf2 (upc_shared_ptr_t);
+extern long double __getsxf2 (upc_shared_ptr_t);
+
+strict shared long double x;
+
+long double p () {
+  return x;
+}
+
+/* { dg-final { scan-tree-dump-times "gets\[tx\]f2" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/get-ti-relaxed.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/get-ti-relaxed.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/get-ti-relaxed.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,21 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+/* { dg-require-effective-target int128 } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+typedef unsigned int uint_ti_t __attribute__ ((__mode__(__TI__)));
+
+/* UPC runtime remote access prototype */
+typedef __SIZE_TYPE__ size_t;
+extern uint_ti_t __getblk3 (void *, upc_shared_ptr_t, size_t);
+
+relaxed shared uint_ti_t x;
+
+uint_ti_t p () {
+  return x;
+}
+
+/* { dg-final { scan-tree-dump-times "getblk3" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/get-ti-strict.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/get-ti-strict.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/get-ti-strict.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,21 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+/* { dg-require-effective-target int128 } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+typedef unsigned int uint_ti_t __attribute__ ((__mode__(__TI__)));
+
+/* UPC runtime remote access prototype */
+typedef __SIZE_TYPE__ size_t;
+extern uint_ti_t __getsblk3 (void *, upc_shared_ptr_t, size_t);
+
+strict shared uint_ti_t x;
+
+uint_ti_t p () {
+  return x;
+}
+
+/* { dg-final { scan-tree-dump-times "getsblk3" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/getaddr.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/getaddr.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/getaddr.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,14 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+/* Runtime API */
+extern void * __getaddr (upc_shared_ptr_t);
+
+shared int *p;
+
+int main () {
+  int *local_p;
+  /* { dg-final { scan-tree-dump-times "local_p = .*__getaddr.* p\\\)" 1 "original" } } */
+  local_p = (void *)p;
+  return 0;
+}
Index: gcc/testsuite/gcc.dg/gupc/gupc.exp
===================================================================
--- gcc/testsuite/gcc.dg/gupc/gupc.exp	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/gupc.exp	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,40 @@ 
+# Copyright (C) 2006-2015 Free Software Foundation, Inc.
+#
+# This file is part of GCC.
+#
+# GCC is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GCC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+if ![check_effective_target_fupc] {
+  return
+}
+
+# For all the test files in the 'gcc.dg/gupc' directory,
+# we only *compile* the programs and must disable the
+# pre-include of gcc-upc.h via -fno-upc-pre-include.
+set upc_flags "-fno-upc-pre-include"
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+dg-runtest [lsort [find $srcdir/$subdir *.upc]] "$upc_flags" ""
+
+# All done.
+dg-finish
Index: gcc/testsuite/gcc.dg/gupc/init-makes-pts-from-int.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/init-makes-pts-from-int.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/init-makes-pts-from-int.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,18 @@ 
+/* Initialization attempts to make a UPC pointer-to-shared value
+   from an integer without a cast.
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+shared int *p_4000;
+
+int main()
+{
+   shared int *p = 0x4000; /* { dg-error "initialization attempts to make a UPC pointer-to-shared value from an integer without a cast" } */
+   p_4000 = p;
+   return 0;
+}
Index: gcc/testsuite/gcc.dg/gupc/invalid-local-ptr-to-void-arith.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/invalid-local-ptr-to-void-arith.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/invalid-local-ptr-to-void-arith.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,21 @@ 
+/* The consensus of the UPC community seems to be that
+   arithmetic on (void *) pointers is a compilation error.
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+int A[10];
+void *p;
+
+int main()
+{
+  p = (void *)A;
+  p = p + 1; /* { dg-error "pointer of type 'void \\*' used in arithmetic \\\[-Werror=pointer-arith\\\]" } */
+  *((int *)p) = 1;
+  return 0;
+}
+/* { dg-excess-errors "some warnings being treated as errors" } */
Index: gcc/testsuite/gcc.dg/gupc/invalid-sizeof-shared-void.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/invalid-sizeof-shared-void.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/invalid-sizeof-shared-void.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,21 @@ 
+/* Invalid application of <op> to shared void.
+   (where <op> is sizeof(0) or __alignof())
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+typedef __SIZE_TYPE__ size_t;
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+shared int A[THREADS];
+
+size_t size;
+
+int main()
+{
+   shared void *p = (shared void *)A;
+   size = sizeof (*p); /* { dg-error "invalid application of 'sizeof' to 'shared void' type" } */
+   return 0;
+}
Index: gcc/testsuite/gcc.dg/gupc/invalid-sizeof-void.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/invalid-sizeof-void.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/invalid-sizeof-void.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,16 @@ 
+/* The consensus of the UPC community seems to be that
+   sizeof (void) is a compilation errors.
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+int main()
+{
+  return sizeof (void); /* { dg-error "invalid application of 'sizeof' to a void type \\\[-Werror=pointer-arith\\\]" } */
+}
+
+/* { dg-excess-errors "some warnings being treated as errors" } */
Index: gcc/testsuite/gcc.dg/gupc/lt-pts-and-local-ptr.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/lt-pts-and-local-ptr.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/lt-pts-and-local-ptr.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,22 @@ 
+/* UPC does not allow comparisons between pointers to shared and
+   local pointers.
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+int x;
+shared int v;
+
+shared int *pts;
+int *local_ptr;
+
+int main (void)
+{
+  local_ptr = &x;
+  pts = &v;
+  return pts < local_ptr; /* { dg-error "UPC does not allow comparisons between pointers to shared and local pointers" } */
+}
Index: gcc/testsuite/gcc.dg/gupc/max-block-size-exceeded.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/max-block-size-exceeded.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/max-block-size-exceeded.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,10 @@ 
+/* Maximum UPC block size in this implementation exceeded.  
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=1" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+shared [UPC_MAX_BLOCK_SIZE+1] int A[(UPC_MAX_BLOCK_SIZE+1)*THREADS]; /* { dg-error "the maximum UPC block size in this implementation is \[0-9\]\*" } */
Index: gcc/testsuite/gcc.dg/gupc/no-closing-layout-qual-bracket.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/no-closing-layout-qual-bracket.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/no-closing-layout-qual-bracket.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,11 @@ 
+/* Expected ] after UPC layout qualifier expression.  
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+shared [5 int A[5 * THREADS]; /* { dg-error "expected \\\] before 'int'" } */
+
Index: gcc/testsuite/gcc.dg/gupc/parm-decl-with-shared-qual.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/parm-decl-with-shared-qual.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/parm-decl-with-shared-qual.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,13 @@ 
+/* Parameter declared with UPC shared qualifier. 
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+int decl_shared_parameter (shared int p) /* { dg-error "parameter declared with UPC shared qualifier" } */
+{
+  return p;
+}
Index: gcc/testsuite/gcc.dg/gupc/passing-arg-makes-pts-from-int.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/passing-arg-makes-pts-from-int.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/passing-arg-makes-pts-from-int.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,18 @@ 
+/* Passing argument attempts to make a UPC pointer-to-shared
+   value from an integer.
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+
+extern void proc (shared int *arg);
+
+int main()
+{
+   proc (0x4000); /* { dg-error "passing argument 1 of 'proc' attempts to make a UPC pointer-to-shared value from an integer" } */
+   return 0;
+}
Index: gcc/testsuite/gcc.dg/gupc/pts-to-void-in-arith.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/pts-to-void-in-arith.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/pts-to-void-in-arith.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,23 @@ 
+/* UPC does not allow a pointer of type `shared void *'
+   to be used in arithmetic.
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+typedef __SIZE_TYPE__ size_t;
+extern int MYTHREAD;
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+shared int A[THREADS];
+shared void *pts;
+shared int  *pts2;
+size_t diff;
+
+int main()
+{
+  pts = (shared void *)&A[0];
+  pts += (MYTHREAD + 1) % THREADS; /* { dg-error "UPC does not allow a pointer of type 'shared void \\*' to be used in arithmetic" } */
+  return 0;
+}
Index: gcc/testsuite/gcc.dg/gupc/put-blk-relaxed.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/put-blk-relaxed.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/put-blk-relaxed.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,21 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+typedef struct { unsigned char c[16]; } blk_t;
+
+/* UPC runtime remote access prototype */
+typedef __SIZE_TYPE__ size_t;
+extern void __putblk3 (upc_shared_ptr_t, void *, size_t);
+
+relaxed shared blk_t x;
+blk_t local_x;
+
+void p () {
+  x = local_x;
+}
+
+/* { dg-final { scan-tree-dump-times "putblk3" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/put-blk-strict.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/put-blk-strict.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/put-blk-strict.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,21 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+typedef struct { unsigned char c[16]; } blk_t;
+
+/* UPC runtime remote access prototype */
+typedef __SIZE_TYPE__ size_t;
+extern void __putsblk3 (upc_shared_ptr_t, void *, size_t);
+
+strict shared blk_t x;
+blk_t local_x;
+
+void p () {
+  x = local_x;
+}
+
+/* { dg-final { scan-tree-dump-times "putsblk3" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/put-df-relaxed.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/put-df-relaxed.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/put-df-relaxed.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,18 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+/* UPC runtime remote access prototype */
+extern void __putdf2 (upc_shared_ptr_t, double);
+
+relaxed shared double x;
+
+void p () {
+  x = 1;
+}
+
+/* { dg-final { scan-tree-dump-times "putdf2" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/put-df-strict.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/put-df-strict.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/put-df-strict.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,18 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+/* UPC runtime remote access prototype */
+extern void __putsdf2 (upc_shared_ptr_t, double);
+
+strict shared double x;
+
+void p () {
+  x = 1;
+}
+
+/* { dg-final { scan-tree-dump-times "putsdf2" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/put-di-relaxed.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/put-di-relaxed.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/put-di-relaxed.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,19 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+typedef unsigned int uint_di_t __attribute__ ((__mode__(__DI__)));
+
+/* UPC runtime remote access prototype */
+extern void __putdi2 (upc_shared_ptr_t, uint_di_t);
+
+relaxed shared uint_di_t x;
+
+void p () {
+  x = 1;
+}
+
+/* { dg-final { scan-tree-dump-times "putdi2" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/put-di-strict.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/put-di-strict.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/put-di-strict.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,19 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+typedef unsigned int uint_di_t __attribute__ ((__mode__(__DI__)));
+
+/* UPC runtime remote access prototype */
+extern void __putsdi2 (upc_shared_ptr_t, uint_di_t);
+
+strict shared uint_di_t x;
+
+void p () {
+  x = 1;
+}
+
+/* { dg-final { scan-tree-dump-times "putsdi2" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/put-hi-relaxed.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/put-hi-relaxed.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/put-hi-relaxed.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,19 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+typedef unsigned int uint_hi_t __attribute__ ((__mode__(__HI__)));
+
+/* UPC runtime remote access prototype */
+extern void __puthi2 (upc_shared_ptr_t, uint_hi_t);
+
+relaxed shared uint_hi_t x;
+
+void p () {
+  x = 1;
+}
+
+/* { dg-final { scan-tree-dump-times "puthi2" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/put-hi-strict.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/put-hi-strict.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/put-hi-strict.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,19 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+typedef unsigned int uint_hi_t __attribute__ ((__mode__(__HI__)));
+
+/* UPC runtime remote access prototype */
+extern void __putshi2 (upc_shared_ptr_t, uint_hi_t);
+
+strict shared uint_hi_t x;
+
+void p () {
+  x = 1;
+}
+
+/* { dg-final { scan-tree-dump-times "putshi2" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/put-qi-relaxed.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/put-qi-relaxed.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/put-qi-relaxed.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,19 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+typedef unsigned int uint_qi_t __attribute__ ((__mode__(__QI__)));
+
+/* UPC runtime remote access prototype */
+extern void __putqi2 (upc_shared_ptr_t, uint_qi_t);
+
+relaxed shared uint_qi_t x;
+
+void p () {
+  x = 1;
+}
+
+/* { dg-final { scan-tree-dump-times "putqi2" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/put-qi-strict.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/put-qi-strict.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/put-qi-strict.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,19 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+typedef unsigned int uint_qi_t __attribute__ ((__mode__(__QI__)));
+
+/* UPC runtime remote access prototype */
+extern void __putsqi2 (upc_shared_ptr_t, uint_qi_t);
+
+strict shared uint_qi_t x;
+
+void p () {
+  x = 1;
+}
+
+/* { dg-final { scan-tree-dump-times "putsqi2" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/put-sf-relaxed.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/put-sf-relaxed.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/put-sf-relaxed.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,18 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+/* UPC runtime remote access prototype */
+extern void __putsf2 (upc_shared_ptr_t, float);
+
+relaxed shared float x;
+
+void p () {
+  x = 1;
+}
+
+/* { dg-final { scan-tree-dump-times "putsf2" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/put-sf-strict.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/put-sf-strict.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/put-sf-strict.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,18 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+/* UPC runtime remote access prototype */
+extern void __putssf2 (upc_shared_ptr_t, float);
+
+strict shared float x;
+
+void p () {
+  x = 1;
+}
+
+/* { dg-final { scan-tree-dump-times "putssf2" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/put-si-relaxed.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/put-si-relaxed.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/put-si-relaxed.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,19 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+typedef unsigned int uint_si_t __attribute__ ((__mode__(__SI__)));
+
+/* UPC runtime remote access prototype */
+extern void __putsi2 (upc_shared_ptr_t, uint_si_t);
+
+relaxed shared uint_si_t x;
+
+void p () {
+  x = 1;
+}
+
+/* { dg-final { scan-tree-dump-times "putsi2" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/put-si-strict.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/put-si-strict.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/put-si-strict.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,19 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+typedef unsigned int uint_si_t __attribute__ ((__mode__(__SI__)));
+
+/* UPC runtime remote access prototype */
+extern void __putssi2 (upc_shared_ptr_t, uint_si_t);
+
+strict shared uint_si_t x;
+
+void p () {
+  x = 1;
+}
+
+/* { dg-final { scan-tree-dump-times "putssi2" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/put-tf-relaxed.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/put-tf-relaxed.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/put-tf-relaxed.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,20 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+/* { dg-require-effective-target longdouble128 } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+/* UPC runtime remote access prototype */
+extern void __puttf2 (upc_shared_ptr_t, long double);
+extern void __putxf2 (upc_shared_ptr_t, long double);
+
+relaxed shared long double x;
+
+void p () {
+  x = 1;
+}
+
+/* { dg-final { scan-tree-dump-times "put\[tx\]f2" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/put-tf-strict.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/put-tf-strict.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/put-tf-strict.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,20 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+/* { dg-require-effective-target longdouble128 } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+/* UPC runtime remote access prototype */
+extern void __putstf2 (upc_shared_ptr_t, long double);
+extern void __putsxf2 (upc_shared_ptr_t, long double);
+
+strict shared long double x;
+
+void p () {
+  x = 1;
+}
+
+/* { dg-final { scan-tree-dump-times "puts\[tx\]f2" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/put-ti-relaxed.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/put-ti-relaxed.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/put-ti-relaxed.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,21 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+/* { dg-require-effective-target int128 } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+typedef unsigned int uint_ti_t __attribute__ ((__mode__(__TI__)));
+
+/* UPC runtime remote access prototype */
+typedef __SIZE_TYPE__ size_t;
+extern void __putblk3 (upc_shared_ptr_t, void *, size_t);
+
+relaxed shared uint_ti_t x;
+
+void p () {
+  x = 1;
+}
+
+/* { dg-final { scan-tree-dump-times "putblk3" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/put-ti-strict.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/put-ti-strict.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/put-ti-strict.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,21 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+/* { dg-require-effective-target int128 } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+typedef unsigned int uint_ti_t __attribute__ ((__mode__(__TI__)));
+
+/* UPC runtime remote access prototype */
+typedef __SIZE_TYPE__ size_t;
+extern void __putsblk3 (upc_shared_ptr_t, void *, size_t);
+
+strict shared uint_ti_t x;
+
+void p () {
+  x = 1;
+}
+
+/* { dg-final { scan-tree-dump-times "putsblk3" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "get|put" 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/relaxed-qual-but-not-shared.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/relaxed-qual-but-not-shared.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/relaxed-qual-but-not-shared.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,11 @@ 
+/* Variable is declared with UPC relaxed qualifier
+   but not shared.
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+relaxed int x; /* { dg-error "'x' is declared with UPC relaxed qualifier but not shared" } */
Index: gcc/testsuite/gcc.dg/gupc/return-makes-pts-from-int.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/return-makes-pts-from-int.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/return-makes-pts-from-int.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,13 @@ 
+/* Return makes a UPC pointer-to-shared value from an integer.  
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+shared int *func ()
+{
+  return 0x4000; /* { dg-error "return makes a UPC pointer-to-shared value from an integer" } */
+}
Index: gcc/testsuite/gcc.dg/gupc/shared-array-init-unsupported.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/shared-array-init-unsupported.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/shared-array-init-unsupported.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,10 @@ 
+/* Initialization of UPC shared arrays is currently not supported.  
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+shared int A[3*THREADS] = {1, 2, 3}; /* { dg-error "initialization of UPC shared arrays is currently not supported" } */
Index: gcc/testsuite/gcc.dg/gupc/shared-auto-var-decl.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/shared-auto-var-decl.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/shared-auto-var-decl.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,14 @@ 
+/* UPC does not support shared auto variables.  
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+int decl_shared_local (int p)
+{
+  shared int x = p; /* { dg-error "UPC does not support shared auto variables" } */
+  return x;
+}
Index: gcc/testsuite/gcc.dg/gupc/shared-init-addr.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/shared-init-addr.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/shared-init-addr.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,20 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+/* Runtime API */
+extern void __upc_init_decls (void);
+extern void __putsi2 (upc_shared_ptr_t, int);
+
+shared int x = 10;
+
+shared int *xp = &x;
+
+int main () {
+  return 0;
+}
+/* { dg-final { scan-tree-dump-times "Function __upc_init_decls" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "__putsi2" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "xp = " 1 "original" } } */
Index: gcc/testsuite/gcc.dg/gupc/shared-var-both-strict-and-relaxed.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/shared-var-both-strict-and-relaxed.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/shared-var-both-strict-and-relaxed.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,11 @@ 
+/* UPC shared variable %qE is declared
+   both strict and relaxed.
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+shared strict relaxed int x; /* { dg-error "UPC shared variable 'x' is declared both strict and relaxed" } */
Index: gcc/testsuite/gcc.dg/gupc/shared-vla-not-allowed.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/shared-vla-not-allowed.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/shared-vla-not-allowed.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,15 @@ 
+/* UPC forbids the declaration of a variable-size shared array. 
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+void declare_shared_vla (int N)
+{
+  shared int A[N*THREADS]; /* { dg-error "UPC does not support shared auto variables" } */
+  A[0] = 1;
+}
+/* { dg-prune-output "UPC forbids variable-size shared array 'A'" } */
Index: gcc/testsuite/gcc.dg/gupc/star-block-factor-applied-to-incomplete-type.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/star-block-factor-applied-to-incomplete-type.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/star-block-factor-applied-to-incomplete-type.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,11 @@ 
+/* UPC layout qualifier of the form [*] cannot be
+   applied to an incomplete type.
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+shared [*] struct s_struct A5_icomplete[5*THREADS]; /* { dg-error "array type has incomplete element type" } */
Index: gcc/testsuite/gcc.dg/gupc/star-block-factor-in-pts-decl.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/star-block-factor-in-pts-decl.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/star-block-factor-in-pts-decl.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,10 @@ 
+/* UPC [*] qualifier may not be used in declaration of pointers.  
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+shared [*] int *pts; /* { dg-error "UPC \\\[\\*\\\] qualifier may not be used in declaration of pointers" } */
Index: gcc/testsuite/gcc.dg/gupc/static-threads-val-too-big.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/static-threads-val-too-big.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/static-threads-val-too-big.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,12 @@ 
+/* THREADS value exceeds UPC implementation limit.  
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2147483647" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+/* Must be compiled with large static value of THREADS.  */
+shared int A[THREADS];
+/* { dg-excess-errors "THREADS value exceeds UPC implementation limit of 1024" } */
Index: gcc/testsuite/gcc.dg/gupc/strict-qual-but-not-shared.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/strict-qual-but-not-shared.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/strict-qual-but-not-shared.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,11 @@ 
+/* Variable is declared with UPC strict qualifier
+   but not shared.
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+strict int x; /* { dg-error "'x' is declared with UPC strict qualifier but not shared" } */
Index: gcc/testsuite/gcc.dg/gupc/upc-blocksizeof-func-type.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/upc-blocksizeof-func-type.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/upc-blocksizeof-func-type.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,20 @@ 
+/* UPC operator applied to a function type.  
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+typedef __SIZE_TYPE__ size_t;
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+
+void func(void) {}
+
+size_t s;
+
+int main()
+{
+  s = upc_blocksizeof (func); /* { dg-error "UPC operator upc_blocksizeof applied to a function type" } */
+  return 0;
+}
Index: gcc/testsuite/gcc.dg/gupc/upc-blocksizeof-non-shared-type.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/upc-blocksizeof-non-shared-type.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/upc-blocksizeof-non-shared-type.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,18 @@ 
+/* UPC operator applied to a non-shared type.  
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+typedef __SIZE_TYPE__ size_t;
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+int x[10];
+size_t s;
+
+int main()
+{
+  s = upc_blocksizeof (x); /* { dg-error "UPC operator upc_blocksizeof applied to a non-shared type" } */
+  return 0;
+}
Index: gcc/testsuite/gcc.dg/gupc/upc-blocksizeof-void-type.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/upc-blocksizeof-void-type.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/upc-blocksizeof-void-type.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,19 @@ 
+/* UPC operator applied to a void type.  
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+typedef __SIZE_TYPE__ size_t;
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+void *p;
+size_t s;
+
+
+int main()
+{
+  s = upc_blocksizeof (*p); /* { dg-error "invalid use of void expression" } */
+  return 0;
+}
Index: gcc/testsuite/gcc.dg/gupc/upc-elemsizeof-func-type.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/upc-elemsizeof-func-type.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/upc-elemsizeof-func-type.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,20 @@ 
+/* UPC operator applied to a function type.  
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+typedef __SIZE_TYPE__ size_t;
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+
+void func(void) {}
+
+size_t s;
+
+int main()
+{
+  s = upc_elemsizeof (func); /* { dg-error "UPC operator upc_elemsizeof applied to a function type" } */
+  return 0;
+}
Index: gcc/testsuite/gcc.dg/gupc/upc-elemsizeof-non-shared-type.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/upc-elemsizeof-non-shared-type.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/upc-elemsizeof-non-shared-type.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,18 @@ 
+/* UPC operator applied to a non-shared type.  
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+typedef __SIZE_TYPE__ size_t;
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+int x[10];
+size_t s;
+
+int main()
+{
+  s = upc_elemsizeof (x); /* { dg-error "UPC operator upc_elemsizeof applied to a non-shared type" } */
+  return 0;
+}
Index: gcc/testsuite/gcc.dg/gupc/upc-elemsizeof-void-type.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/upc-elemsizeof-void-type.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/upc-elemsizeof-void-type.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,19 @@ 
+/* UPC operator applied to a void type.  
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+typedef __SIZE_TYPE__ size_t;
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+void *p;
+size_t s;
+
+
+int main()
+{
+  s = upc_elemsizeof (*p); /* { dg-error "invalid use of void expression" } */
+  return 0;
+}
Index: gcc/testsuite/gcc.dg/gupc/upc-localsizeof-func-type.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/upc-localsizeof-func-type.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/upc-localsizeof-func-type.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,20 @@ 
+/* UPC operator applied to a function type.  
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+typedef __SIZE_TYPE__ size_t;
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+
+void func(void) {}
+
+size_t s;
+
+int main()
+{
+  s = upc_localsizeof (func); /* { dg-error "UPC operator upc_localsizeof applied to a function type" } */
+  return 0;
+}
Index: gcc/testsuite/gcc.dg/gupc/upc-localsizeof-non-shared-type.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/upc-localsizeof-non-shared-type.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/upc-localsizeof-non-shared-type.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,18 @@ 
+/* UPC operator applied to a non-shared type.  
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+typedef __SIZE_TYPE__ size_t;
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+int x[10];
+size_t s;
+
+int main()
+{
+  s = upc_localsizeof (x); /* { dg-error "UPC operator upc_localsizeof applied to a non-shared type" } */
+  return 0;
+}
Index: gcc/testsuite/gcc.dg/gupc/upc-localsizeof-void-type.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/upc-localsizeof-void-type.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/upc-localsizeof-void-type.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,19 @@ 
+/* UPC operator applied to a void type.  
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+typedef __SIZE_TYPE__ size_t;
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+void *p;
+size_t s;
+
+
+int main()
+{
+  s = upc_localsizeof (*p); /* { dg-error "invalid use of void expression" } */
+  return 0;
+}
Index: gcc/testsuite/gcc.dg/gupc/warn-junk-at-end-pragma-upc.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/warn-junk-at-end-pragma-upc.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/warn-junk-at-end-pragma-upc.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,12 @@ 
+/* Warning: junk at end of #pragma upc.  
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+#pragma upc strict junk /* { dg-warning "junk at end of #pragma upc \\\[-Wpragmas\\\]" } */
+shared int x;
+
Index: gcc/testsuite/gcc.dg/gupc/warn-missing-param-after-pragma-upc.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/warn-missing-param-after-pragma-upc.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/warn-missing-param-after-pragma-upc.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,12 @@ 
+/* Warning: missing parameter after #pragma upc.  
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+
+
+
+#pragma upc  /* { dg-warning "missing parameter after #pragma upc \\\[-Wpragmas\\\]" } */
+shared int x;
+
Index: gcc/testsuite/gcc.dg/gupc/warn-pragma-upc-bad-context.upc
===================================================================
--- gcc/testsuite/gcc.dg/gupc/warn-pragma-upc-bad-context.upc	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gupc/warn-pragma-upc-bad-context.upc	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,22 @@ 
+/* Warning: #pragma upc not allowed in this context.  
+	{ dg-do compile }
+	{ dg-options "-fupc-threads=2" } */
+
+/* The base address of the UPC shared section */
+extern char __upc_shared_start[1];
+extern void __putsi2 (upc_shared_ptr_t, int);
+
+
+shared int v;
+
+shared int *pts;
+
+int main (void)
+{
+  pts = &v;
+  /* pragma upc must appear contextually as first token
+     after opening brace.  Invalid here.  */
+  #pragma upc strict /* { dg-warning "#pragma upc not allowed in this context \\\[-Wpragmas\\\]" } */
+  *pts = 1;
+  return 0;
+}
Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp	(.../trunk)	(revision 231059)
+++ gcc/testsuite/lib/target-supports.exp	(.../branches/gupc)	(revision 231080)
@@ -876,6 +876,15 @@  proc check_effective_target_fopenmp {} {
     } "-fopenmp"]
 }
 
+# Return 1 if compilation with -fupc is error-free for trivial
+# code, 0 otherwise.
+
+proc check_effective_target_fupc {} {
+    return [check_no_compiler_messages fupc object {
+	void foo (void) { }
+    } "-fupc -fno-upc-pre-include"]
+}
+
 # Return 1 if compilation with -fgnu-tm is error-free for trivial
 # code, 0 otherwise.
 
@@ -6023,6 +6032,33 @@  proc add_options_for_double_vectors { fl
     return $flags
 }
 
+# Add to FLAGS the flags needed to disable inlining of
+# UPC run-time access routines.
+
+proc add_options_for_upc_library_calls { flags } {
+    return "$flags -fno-upc-inline-lib"
+}
+
+# Check if UPC struct pts build
+
+proc check_effective_target_upc_struct_pts { } {
+    return [check_no_compiler_messages upc_struct_pts object {
+	#ifndef __UPC_PTS_STRUCT_REP__
+	#  error struct PTS is not supported
+	#endif
+    } "-fupc -fno-upc-pre-include" ]
+}
+
+# Check if UPC packed pts build
+
+proc check_effective_target_upc_packed_pts { } {
+    return [check_no_compiler_messages upc_packed_pts object {
+	#ifndef __UPC_PTS_PACKED_REP__
+	#  error packed PTS is not supported
+	#endif
+    } "-fupc -fno-upc-pre-include" ]
+}
+
 # Return 1 if the target provides a full C99 runtime.
 
 proc check_effective_target_c99_runtime { } {