aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/sh/pr54760-1.c
blob: 4437511cf7c93c83cd35769ebc02475069a902b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* Check that the __builtin_thread_pointer and __builtin_set_thread_pointer
   built-in functions result in gbr store / load instructions.  */
/* { dg-do compile }  */
/* { dg-options "-O1" } */
/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } }  */
/* { dg-final { scan-assembler-times "ldc" 1 } } */
/* { dg-final { scan-assembler-times "stc" 1 } } */
/* { dg-final { scan-assembler-times "gbr" 2 } } */

void*
test00 (void)
{
  return __builtin_thread_pointer ();
}

void
test01 (void* p)
{
  __builtin_set_thread_pointer (p);
}