| 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 } } */ |
| 8 |
|
| 9 |
void* |
| 10 |
test00 (void) |
| 11 |
{ |
| 12 |
return __builtin_thread_pointer (); |
| 13 |
} |
| 14 |
|
| 15 |
void |
| 16 |
test01 (void* p) |
| 17 |
{ |
| 18 |
__builtin_set_thread_pointer (p); |
| 19 |
} |