1 /* { dg-do compile { target nios2-*-linux-gnu } } */
2 /* { dg-options "-O2 -fpic" } */
3 /* { dg-final { scan-assembler-not "ldw\tr., %lo" } } */
4 /* { dg-final { scan-assembler-not "stw\tr., %lo" } } */
6 /* Check that address transformations for symbolic constants do NOT
7 apply to code compiled with -fPIC, which requires references to
8 go through the GOT pointer (r22) instead. */
21 extern struct ss S4
[];
23 TYPE
*addr1 (void) { return &S1
; }
24 TYPE
get1 (void) { return S1
; }
25 void set1 (TYPE value
) { S1
= value
; }
27 TYPE
*addr2 (int i
) { return &(S2
[i
]); }
28 TYPE
get2 (int i
) { return S2
[i
]; }
29 void set2 (int i
, TYPE value
) { S2
[i
] = value
; }
31 TYPE
*addr3 (void) { return &(S3
.x2
); }
32 TYPE
get3 (void) { return S3
.x2
; }
33 void set3 (TYPE value
) { S3
.x2
= value
; }
35 TYPE
*addr4 (int i
) { return &(S4
[i
].x2
); }
36 TYPE
get4 (int i
) { return S4
[i
].x2
; }
37 void set4 (int i
, TYPE value
) { S4
[i
].x2
= value
; }