From: Nathan Sidwell Date: Fri, 13 Nov 2015 21:48:23 +0000 (+0000) Subject: target-supports.exp (check_effective_target_offload_nvptx): New. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7bcc3c8608f201d618b27dc6fbf3aaf176599033;p=gcc.git target-supports.exp (check_effective_target_offload_nvptx): New. * lib/target-supports.exp (check_effective_target_offload_nvptx): New. * gcc.dg/goacc/nvptx-merged-loop.c: New. From-SVN: r230353 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e01d0c6fc17..68cf4e946fe 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-11-13 Nathan Sidwell + + * lib/target-supports.exp (check_effective_target_offload_nvptx): New. + * gcc.dg/goacc/nvptx-merged-loop.c: New. + 2015-11-13 Steven G. Kargl PR fortran/68319 diff --git a/gcc/testsuite/gcc.dg/goacc/nvptx-merged-loop.c b/gcc/testsuite/gcc.dg/goacc/nvptx-merged-loop.c new file mode 100644 index 00000000000..3ff537c1d97 --- /dev/null +++ b/gcc/testsuite/gcc.dg/goacc/nvptx-merged-loop.c @@ -0,0 +1,30 @@ +/* { dg-do link } */ +/* { dg-require-effective-target offload_nvptx } */ +/* { dg-options "-fopenacc -O2 -foffload=-fdump-rtl-mach\\ -dumpbase\\ nvptx-merged-loop.c\\ -Wa,--no-verify" } */ + +#define N (32*32*32+17) +void __attribute__ ((noinline)) Foo (int *ary) +{ + int ix; + +#pragma acc parallel num_workers(32) vector_length(32) copyout(ary[0:N]) + { + /* Loop partitioning should be merged. */ +#pragma acc loop worker vector + for (unsigned ix = 0; ix < N; ix++) + { + ary[ix] = ix; + } + } +} + +int main () +{ + int ary[N]; + + Foo (ary); + + return 0; +} + +/* { dg-final { scan-rtl-dump "Merging loop .* into " "mach" } } */ diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 75d50682922..328d483226e 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -6716,3 +6716,11 @@ proc check_effective_target_vect_max_reduc { } { } return 0 } + +# Return 1 if there is an nvptx offload compiler. + +proc check_effective_target_offload_nvptx { } { + return [check_no_compiler_messages offload_nvptx object { + int main () {return 0;} + } "-foffload=nvptx-none" ] +}