1 /* Check that these thread relative memory accesses play along with
3 These should be moved to C torture tests once there are target
4 independent thread_pointer built-in functions available. */
5 /* { dg-do compile } */
6 /* { dg-options "-O1" } */
9 test00 (void* p
, int x
)
11 int* tcb
= (int*)__builtin_thread_pointer ();
14 __builtin_set_thread_pointer (p
);
16 tcb
= (int*)__builtin_thread_pointer ();
23 unsigned short* tcb
= (unsigned short*)__builtin_thread_pointer ();
28 test02 (int* x
, int a
, int b
)
30 int* tcb
= (int*)__builtin_thread_pointer ();
33 __builtin_set_thread_pointer (x
);
35 tcb
= (int*)__builtin_thread_pointer ();
40 test03 (const int* x
, int c
)
42 volatile int* tcb
= (volatile int*)__builtin_thread_pointer ();
46 for (i
= 0; i
< c
; ++i
)
53 test04 (const int* x
, int c
, int** xx
, int d
)
57 for (i
= 0; i
< c
; ++i
)
59 volatile int* tcb
= (volatile int*)__builtin_thread_pointer ();
62 __builtin_set_thread_pointer (xx
[i
]);
64 tcb
= (volatile int*)__builtin_thread_pointer ();
65 s
^= x
[i
] + tcb
[40] + d
;