gcc/libgomp/testsuite/libgomp.oacc-c-c++-common/nvptx-sese-1.c
Tom de Vries 49188cd1f2 [nvptx, libgomp] Move rtl-dump test-cases to libgomp
The goacc.exp test-cases nvptx-merged-loop.c and nvptx-sese-1.c are failing
during linking due to missing libgomp.spec.

Move them to the libgomp testsuite.

Build and reg-tested on x86_64 with nvptx accelerator.

2018-12-19  Tom de Vries  <tdevries@suse.de>

	* gcc.dg/goacc/nvptx-merged-loop.c: Move to
	libgomp/testsuite/libgomp.oacc-c-c++-common.
	* gcc.dg/goacc/nvptx-sese-1.c: Same.

	* testsuite/lib/libgomp.exp: Add load_lib of scanoffloadrtl.exp.
	* testsuite/libgomp.oacc-c-c++-common/nvptx-merged-loop.c: Move from
	gcc/testsuite/gcc.dg/goacc.
	* testsuite/libgomp.oacc-c-c++-common/nvptx-sese-1.c: Same.

From-SVN: r267267
2018-12-19 14:20:44 +00:00

36 lines
775 B
C

/* { dg-do run { target openacc_nvidia_accel_selected } } */
/* { dg-options "-foffload=-fdump-rtl-mach" } */
/* { dg-skip-if "" { *-*-* } { "*" } { "-O2" } } */
#pragma acc routine seq
int __attribute__((noinline)) foo (int x)
{
return x & 2;
}
int main ()
{
int r = 0;
#pragma acc parallel copy(r) vector_length(32)
{
#pragma acc loop vector reduction (+:r)
for (int i = 00; i < 40; i++)
r += i;
/* This piece is a multi-block SESE region */
if (foo (r))
r *= 2;
if (r & 1) /* to here. */
#pragma acc loop vector reduction (+:r)
for (int i = 00; i < 40; i++)
r += i;
}
return 0;
}
/* Match {N->N(.N)+} */
/* { dg-final { scan-offload-rtl-dump "SESE regions:.* \[0-9\]+{\[0-9\]+->\[0-9\]+(\\.\[0-9\]+)+}" "mach" } } */