From: Thomas Schwinge Date: Fri, 12 Dec 2014 20:01:29 +0000 (+0100) Subject: OpenMP target nesting tests. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=88c7eae209d973c8f7e72ba199e4153aef18992b;p=gcc.git OpenMP target nesting tests. gcc/testsuite/ * c-c++-common/gomp/nesting-1.c: New file. * c-c++-common/gomp/nesting-warn-1.c: Likewise. From-SVN: r218687 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8e5b4248528..f2502ff70fc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-12-12 Thomas Schwinge + + * c-c++-common/gomp/nesting-1.c: New file. + * c-c++-common/gomp/nesting-warn-1.c: Likewise. + 2014-12-12 Kai Tietz PR c++/63996 diff --git a/gcc/testsuite/c-c++-common/gomp/nesting-1.c b/gcc/testsuite/c-c++-common/gomp/nesting-1.c new file mode 100644 index 00000000000..711ff8ea86b --- /dev/null +++ b/gcc/testsuite/c-c++-common/gomp/nesting-1.c @@ -0,0 +1,75 @@ +extern int i; + +void +f_omp_parallel (void) +{ +#pragma omp parallel + { +#pragma omp parallel + ; + +#pragma omp target + ; + +#pragma omp target data + ; + +#pragma omp target update to(i) + +#pragma omp target data + { +#pragma omp parallel + ; + +#pragma omp target + ; + +#pragma omp target data + ; + +#pragma omp target update to(i) + } + } +} + +void +f_omp_target (void) +{ +#pragma omp target + { +#pragma omp parallel + ; + } +} + +void +f_omp_target_data (void) +{ +#pragma omp target data + { +#pragma omp parallel + ; + +#pragma omp target + ; + +#pragma omp target data + ; + +#pragma omp target update to(i) + +#pragma omp target data + { +#pragma omp parallel + ; + +#pragma omp target + ; + +#pragma omp target data + ; + +#pragma omp target update to(i) + } + } +} diff --git a/gcc/testsuite/c-c++-common/gomp/nesting-warn-1.c b/gcc/testsuite/c-c++-common/gomp/nesting-warn-1.c new file mode 100644 index 00000000000..c39dd49f123 --- /dev/null +++ b/gcc/testsuite/c-c++-common/gomp/nesting-warn-1.c @@ -0,0 +1,23 @@ +extern int i; + +void +f_omp_target (void) +{ +#pragma omp target + { +#pragma omp target /* { dg-warning "target construct inside of target region" } */ + ; +#pragma omp target data /* { dg-warning "target data construct inside of target region" } */ + ; +#pragma omp target update to(i) /* { dg-warning "target update construct inside of target region" } */ + +#pragma omp parallel + { +#pragma omp target /* { dg-warning "target construct inside of target region" } */ + ; +#pragma omp target data /* { dg-warning "target data construct inside of target region" } */ + ; +#pragma omp target update to(i) /* { dg-warning "target update construct inside of target region" } */ + } + } +}