1 /* { dg-do compile } */
2 /* { dg-options "-O3 -mno-pc-relative-literal-loads" } */
3 /* { dg-skip-if "Tiny model won't generate adrp" { *-*-* } { "-mcmodel=tiny" } { "" } } */
4
d0(void)5 double d0(void)
6 {
7 double x = 0.0d;
8 return x;
9 }
10
dn1(void)11 double dn1(void)
12 {
13 double x = -0.0d;
14 return x;
15 }
16
17
d1(void)18 double d1(void)
19 {
20 double x = 1.5d;
21 return x;
22 }
23
d2(void)24 double d2(void)
25 {
26 double x = 123256.0d;
27 return x;
28 }
29
d3(void)30 double d3(void)
31 {
32 double x = 123256123456.0d;
33 return x;
34 }
35
d4(void)36 double d4(void)
37 {
38 double x = 123456123456123456.0d;
39 return x;
40 }
41
42 /* { dg-final { scan-assembler-times "movi\td\[0-9\]+, #?0" 1 } } */
43
44 /* { dg-final { scan-assembler-times "adrp\tx\[0-9\]+, \.LC\[0-9\]" 2 } } */
45 /* { dg-final { scan-assembler-times "ldr\td\[0-9\]+, \\\[x\[0-9\], #:lo12:\.LC\[0-9\]\\\]" 2 } } */
46
47 /* { dg-final { scan-assembler-times "fmov\td\[0-9\]+, 1\\\.5e\\\+0" 1 } } */
48
49 /* { dg-final { scan-assembler-times "mov\tx\[0-9\]+, 25838523252736" 1 } } */
50 /* { dg-final { scan-assembler-times "movk\tx\[0-9\]+, 0x40fe, lsl 48" 1 } } */
51 /* { dg-final { scan-assembler-times "mov\tx\[0-9\]+, -9223372036854775808" 1 } } */
52 /* { dg-final { scan-assembler-times "fmov\td\[0-9\]+, x\[0-9\]+" 2 } } */
53
54