2016-08-04 Thomas Schwinge <thomas@codesourcery.com>
+ * testsuite/libgomp.oacc-c++/routine-1-auto.C: New file.
+ * testsuite/libgomp.oacc-c++/routine-1-template-auto.C: Likewise.
+ * testsuite/libgomp.oacc-c++/routine-1-template-trailing-return-type.C:
+ Likewise.
+ * testsuite/libgomp.oacc-c++/routine-1-template.C: Likewise.
+ * testsuite/libgomp.oacc-c++/routine-1-trailing-return-type.C:
+ Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/routine-1.c: Adjust.
+
* testsuite/libgomp.oacc-c-c++-common/crash-1.c: Make it a "link"
test, and don't hardcode -O0.
--- /dev/null
+// Routine with "auto" return type.
+
+// { dg-additional-options "-fno-exceptions" }
+
+#define TEMPLATE
+#define TYPE int
+#define RETURN_1 auto
+#define RETURN_2
+#include "../libgomp.oacc-c-c++-common/routine-1.c"
--- /dev/null
+// Templated routine with "auto" return type.
+
+// { dg-additional-options "-fno-exceptions" }
+
+#define TEMPLATE template<typename TYPE>
+#define RETURN_1 auto
+#define RETURN_2
+#include "../libgomp.oacc-c-c++-common/routine-1.c"
--- /dev/null
+// Templated routine using trailing return type syntax.
+
+// { dg-additional-options "-fno-exceptions" }
+
+#define TEMPLATE template<typename TYPE>
+#define RETURN_1 auto
+#define RETURN_2 -> TYPE
+#include "../libgomp.oacc-c-c++-common/routine-1.c"
--- /dev/null
+// Templated routine.
+
+// { dg-additional-options "-fno-exceptions" }
+
+#define TEMPLATE template<typename TYPE>
+#define RETURN_1 TYPE
+#define RETURN_2
+#include "../libgomp.oacc-c-c++-common/routine-1.c"
--- /dev/null
+// Routine using trailing return type syntax.
+
+// { dg-additional-options "-fno-exceptions" }
+
+#define TEMPLATE
+#define TYPE int
+#define RETURN_1 auto
+#define RETURN_2 -> TYPE
+#include "../libgomp.oacc-c-c++-common/routine-1.c"
// { dg-additional-options "-fno-exceptions" }
-#include <stdio.h>
+// Defaults, if not "#include"d from ../libgomp.oacc-c++/routine-1-*.C.
+#ifndef TEMPLATE
+# define TEMPLATE
+# define TYPE int
+# define RETURN_1 TYPE
+# define RETURN_2
+#endif
+
#include <stdlib.h>
#pragma acc routine
-int fact(int n)
+TEMPLATE
+RETURN_1 fact(TYPE n) RETURN_2
{
if (n == 0 || n == 1)
return 1;