Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.target / s390 / larl-1.c
blob5ef2ef63f82f06347b2f41d06d7eaf8261490d73
1 /* Check if load-address-relative instructions are created */
3 /* { dg-do compile { target { s390*-*-* } } } */
4 /* { dg-options "-O2 -march=z10 -mzarch -fno-section-anchors" } */
6 /* An explicitely misaligned symbol. This symbol is NOT aligned as
7 mandated by our ABI. However, the back-end needs to handle that in
8 order to make things like __attribute__((packed)) work. The symbol
9 address is expected to be loaded from literal pool. */
10 /* { dg-final { scan-assembler "lgrl\t%r2," { target { lp64 } } } } */
11 /* { dg-final { scan-assembler "lrl\t%r2," { target { ! lp64 } } } } */
12 extern char align1 __attribute__((aligned(1)));
14 /* { dg-final { scan-assembler "larl\t%r2,align2" } } */
15 extern char align2 __attribute__((aligned(2)));
17 /* { dg-final { scan-assembler "larl\t%r2,align4" } } */
18 extern char align4 __attribute__((aligned(4)));
20 /* An external char symbol without explicit alignment has a DECL_ALIGN
21 of just 8. In contrast to local definitions DATA_ABI_ALIGNMENT is
22 NOT applied to DECL_ALIGN in that case. Make sure the backend
23 still assumes this symbol to be aligned according to ABI
24 requirements. */
25 /* { dg-final { scan-assembler "larl\t%r2,align_default" } } */
26 extern char align_default;
28 char * foo1 () { return &align1; }
29 char * foo2 () { return &align2; }
30 char * foo3 () { return &align4; }
31 char * foo4 () { return &align_default; }