C++ OpenACC routine directive testing: templated, and "auto", trailing return type syntax
libgomp/ * 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. From-SVN: r239126
This commit is contained in:
parent
9ef64248fe
commit
bbc79c0e9e
7 changed files with 61 additions and 2 deletions
|
@ -1,5 +1,14 @@
|
|||
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.
|
||||
|
||||
|
|
9
libgomp/testsuite/libgomp.oacc-c++/routine-1-auto.C
Normal file
9
libgomp/testsuite/libgomp.oacc-c++/routine-1-auto.C
Normal file
|
@ -0,0 +1,9 @@
|
|||
// 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"
|
|
@ -0,0 +1,8 @@
|
|||
// 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"
|
|
@ -0,0 +1,8 @@
|
|||
// 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"
|
8
libgomp/testsuite/libgomp.oacc-c++/routine-1-template.C
Normal file
8
libgomp/testsuite/libgomp.oacc-c++/routine-1-template.C
Normal file
|
@ -0,0 +1,8 @@
|
|||
// 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"
|
|
@ -0,0 +1,9 @@
|
|||
// 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"
|
|
@ -1,10 +1,18 @@
|
|||
// { 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;
|
||||
|
|
Loading…
Add table
Reference in a new issue