Stop only if there aren't any usable algorithms
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / pr54445-1.c
blobebac532eb75b0aba6f5185b801e3c52bbd3ef0e5
1 /* { dg-do run { target tls_runtime } } */
2 /* { dg-options "-O2" } */
3 /* { dg-add-options tls } */
5 __thread unsigned char tls_array[64];
7 unsigned char
8 __attribute__ ((noinline))
9 tls_array_lookup_with_negative_constant(long long int position) {
10 return tls_array[position - 1];
13 int
14 main ()
16 int i;
18 for (i = 0; i < sizeof (tls_array) / sizeof (tls_array[0]); i++)
19 tls_array[i] = i;
21 for (i = 0; i < sizeof (tls_array) / sizeof (tls_array[0]); i++)
22 if (i != tls_array_lookup_with_negative_constant (i + 1))
23 __builtin_abort ();
24 return 0;