Mercurial > hg > CbC > CbC_gcc
diff gcc/testsuite/c-c++-common/gomp/pr70550-1.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gcc/testsuite/c-c++-common/gomp/pr70550-1.c Fri Oct 27 22:46:09 2017 +0900 @@ -0,0 +1,81 @@ +/* PR middle-end/70550 */ +/* { dg-do compile } */ +/* { dg-additional-options "-Wuninitialized" } */ + +#ifdef __SIZEOF_INT128__ +typedef __int128 T; +#else +typedef long long T; +#endif + +void bar (T); +#pragma omp declare target (bar) + +void +foo (void) +{ + { + int i; + #pragma omp target defaultmap(tofrom:scalar) /* { dg-bogus "is used uninitialized in this function" } */ + { + i = 26; + bar (i); + } + } + { + T j; + #pragma omp target defaultmap(tofrom:scalar) /* { dg-bogus "is used uninitialized in this function" } */ + { + j = 37; + bar (j); + } + } + { + int i; + #pragma omp target /* { dg-bogus "is used uninitialized in this function" } */ + { + i = 26; + bar (i); + } + } + { + T j; + #pragma omp target /* { dg-bogus "is used uninitialized in this function" } */ + { + j = 37; + bar (j); + } + } + { + int i; + #pragma omp target firstprivate (i) /* { dg-warning "is used uninitialized in this function" } */ + { + i = 26; + bar (i); + } + } + { + T j; + #pragma omp target firstprivate (j) /* { dg-warning "is used uninitialized in this function" } */ + { + j = 37; + bar (j); + } + } + { + int i; + #pragma omp target private (i) /* { dg-bogus "is used uninitialized in this function" } */ + { + i = 26; + bar (i); + } + } + { + T j; + #pragma omp target private (j) /* { dg-bogus "is used uninitialized in this function" } */ + { + j = 37; + bar (j); + } + } +}