2 /* { dg-options "-O2 --save-temps -fno-inline" } */
4 extern void abort (void);
7 subs_si_test1 (int a
, int b
, int c
)
11 /* { dg-final { scan-assembler "subs\tw\[0-9\]+, w\[0-9\]+, w\[0-9\]+" } } */
19 subs_si_test2 (int a
, int b
, int c
)
23 /* { dg-final { scan-assembler "subs\tw\[0-9\]+, w\[0-9\]+, #255" } } */
31 subs_si_test3 (int a
, int b
, int c
)
35 /* { dg-final { scan-assembler "subs\tw\[0-9\]+, w\[0-9\]+, w\[0-9\]+, lsl 3" } } */
42 typedef long long s64
;
45 subs_di_test1 (s64 a
, s64 b
, s64 c
)
49 /* { dg-final { scan-assembler "subs\tx\[0-9\]+, x\[0-9\]+, x\[0-9\]+" } } */
57 subs_di_test2 (s64 a
, s64 b
, s64 c
)
61 /* { dg-final { scan-assembler "subs\tx\[0-9\]+, x\[0-9\]+, #255" } } */
69 subs_di_test3 (s64 a
, s64 b
, s64 c
)
73 /* { dg-final { scan-assembler "subs\tx\[0-9\]+, x\[0-9\]+, x\[0-9\]+, lsl 3" } } */
85 x
= subs_si_test1 (29, 4, 5);
89 x
= subs_si_test1 (20, 2, 20);
93 x
= subs_si_test2 (0xff, 4, 5);
97 x
= subs_si_test2 (1024, 2, 20);
98 if (x
!= (1024 - 0xff))
101 x
= subs_si_test3 (35, 4, 5);
102 if (x
!= 35 - (4 << 3))
105 x
= subs_si_test3 (5 << 3, 5, 20);
106 if (x
!= (20 + (5 << 3)))
109 y
= subs_di_test1 (0x130000029ll
,
113 if (y
!= (0x130000029ll
- 0x505050505ll
))
116 y
= subs_di_test1 (0x5000500050005ll
,
119 if (y
!= (0x5000500050005ll
+ 0x5000500050005ll
))
122 y
= subs_di_test2 (0x130000029ll
,
125 if (y
!= (0x130000029ll
- 0xff))
128 y
= subs_di_test2 (0xff,
131 if (y
!= (0xff + 0x505050505ll
))
134 y
= subs_di_test3 (0x130000029ll
,
137 if (y
!= (0x130000029ll
- (0x064000008ll
<< 3)))
140 y
= subs_di_test3 (0x130002900ll
<< 3,
143 if (y
!= (0x505050505ll
+ (0x130002900ll
<< 3)))