2018-02-09 Sebastian Perta <sebastian.perta@renesas.com>
[official-gcc.git] / gcc / testsuite / gcc.target / sh / pr54760-5.c
blob824025db08cc64d3f58c832ba21d116fbfc4b35e
1 /* Check that the GBR address optimization works when there are multiple
2 GBR register definitions and function calls, if the GBR is marked as a
3 call saved register. */
4 /* { dg-do compile } */
5 /* { dg-options "-O1 -fcall-saved-gbr" } */
6 /* { dg-final { scan-assembler-not "stc\tgbr" } } */
8 typedef struct
10 int x, y, z, w;
11 } tcb_t;
13 extern void test_00 (void);
15 int
16 test_01 (int x, volatile int* y, int a)
18 if (a)
19 test_00 ();
21 y[0] = 1;
23 tcb_t* tcb = (tcb_t*)__builtin_thread_pointer ();
24 return (a & 5) ? tcb->x : tcb->w;