gcc/testsuite/gcc.dg/tls/pr66470.c
raw| 1 | /* PR target/66470 */ |
| 2 | /* { dg-do compile } */ |
| 3 | /* { dg-options "-O2" } */ |
| 4 | /* { dg-require-effective-target tls } */ |
| 5 | |
| 6 | extern __thread unsigned long long a[10]; |
| 7 | extern __thread struct S { int a, b; } b[10]; |
| 8 | |
| 9 | unsigned long long |
| 10 | foo (long x) |
| 11 | { |
| 12 | return a[x]; |
| 13 | } |
| 14 | |
| 15 | struct S |
| 16 | bar (long x) |
| 17 | { |
| 18 | return b[x]; |
| 19 | } |
| 20 | |
| 21 | #ifdef __SIZEOF_INT128__ |
| 22 | extern __thread unsigned __int128 c[10]; |
| 23 | |
| 24 | unsigned __int128 |
| 25 | baz (long x) |
| 26 | { |
| 27 | return c[x]; |
| 28 | } |
| 29 | #endif |