[testsuite] Fix directives order
[official-gcc.git] / gcc / testsuite / gcc.target / s390 / nodatarel-1.c
blob1d589a109472292e57525d2da31720faebb743d2
1 /* Test -mno-pic-data-is-text-relative option. No relative addressing
2 of elements in .data and .bss are allowed with that option. */
4 /* { dg-do compile } */
5 /* { dg-options "-O3 -fno-optimize-sibling-calls -fpic -mno-pic-data-is-text-relative -march=z10 -mtune=z9-109 -mzarch" } */
7 static int a = 3;
9 /* With -mno-pic-data-is-text-relative these must be addressed via
10 GOT. */
12 int __attribute__((noinline,noclone))
13 foo ()
15 return a;
18 static int __attribute__((noinline,noclone))
19 foostatic (void)
21 return a;
24 /* Just to make a potentially modified. */
26 void
27 bar (int b)
29 a = b;
32 /* { dg-final { scan-assembler-times "a@GOTENT" 3 } } */
34 /* The exrl target is a label_ref which should not be affected at
35 all. */
37 void
38 mymemcpy (char *dst, char *src, long size)
40 __builtin_memcpy (dst, src, size);
43 /* { dg-final { scan-assembler "exrl" } } */
46 /* PLT slots can still be addressed relatively. */
48 int
49 callfoo ()
51 return foo ();
54 /* { dg-final { scan-assembler-times "foo@PLT" 1 } } */
57 /* GOT entries can still be addressed relatively. */
59 void *
60 fooptr ()
62 return &foo;
65 /* { dg-final { scan-assembler-times "foo@GOTENT" 1 } } */
68 /* A static function can be addressed relatively. */
70 int
71 callfoostatic ()
73 return foostatic ();
76 void *
77 foostaticptr ()
79 return &foostatic;
83 /* { dg-final { scan-assembler-not "foostatic@" } } */