PR target/83368
[official-gcc.git] / gcc / testsuite / gcc.target / sh / pr54760-1.c
blob8bc5836f71fb19caeebecb950264f739c6fcb180
1 /* Check that the __builtin_thread_pointer and __builtin_set_thread_pointer
2 built-in functions result in gbr store / load instructions. */
3 /* { dg-do compile } */
4 /* { dg-options "-O1" } */
5 /* { dg-final { scan-assembler-times "ldc" 1 } } */
6 /* { dg-final { scan-assembler-times "stc" 1 } } */
7 /* { dg-final { scan-assembler-times "gbr" 2 } } */
9 void*
10 test00 (void)
12 return __builtin_thread_pointer ();
15 void
16 test01 (void* p)
18 __builtin_set_thread_pointer (p);