match.pd: Fold vec_perm with view_convert
[official-gcc.git] / gcc / testsuite / gcc.dg / tls / opt-2.c
blob868b97c5b339c02234fab6f60d501450914f660c
1 /* This testcase generated invalid assembly on IA-32,
2 since %gs:0 memory load was not exposed to the compiler
3 as memory load and mem to mem moves are not possible
4 on IA-32. */
5 /* { dg-do link } */
6 /* { dg-options "-O2 -ftls-model=initial-exec" } */
7 /* { dg-options "-O2 -ftls-model=initial-exec -march=i686" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
8 /* { dg-require-effective-target tls } */
9 /* { dg-require-effective-target tls_runtime } */
11 __thread int thr;
13 struct A
15 unsigned int a, b, c, d, e;
18 int bar (int x, unsigned long y, void *z)
20 return 0;
23 int
24 foo (int x, int y, const struct A *z)
26 struct A b;
27 int d;
29 b = *z;
30 d = bar (x, y, &b);
31 if (d == 0 && y == 0x5402)
33 int e = thr;
34 d = bar (x, 0x5401, &b);
35 if (d)
37 thr = e;
38 d = 0;
40 else if ((z->c & 0600) != (b.c & 0600)
41 || ((z->c & 060) && ((z->c & 060) != (b.c & 060))))
43 thr = 22;
44 d = -1;
48 return d;
51 int main (void)
53 foo (1, 2, 0);
54 return 0;