gcc/testsuite/g++.dg/gomp/tpl-parallel-1.C
raw| 1 | // { dg-do compile } |
| 2 | |
| 3 | int check; |
| 4 | |
| 5 | template<typename T> void foo() |
| 6 | { |
| 7 | check |= sizeof(T); |
| 8 | } |
| 9 | |
| 10 | template<typename T> |
| 11 | void bar(void) |
| 12 | { |
| 13 | #pragma omp parallel if (0) |
| 14 | foo<T>(); |
| 15 | } |
| 16 | |
| 17 | int main() |
| 18 | { |
| 19 | bar<char>(); |
| 20 | bar<short>(); |
| 21 | if (check != (sizeof(char) | sizeof(short))) |
| 22 | __builtin_trap (); |
| 23 | return 0; |
| 24 | } |