[gcc]
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / tst-1.c
blobb37c522e2b3bec2c02bf3efed95ae912e881f499
1 /* { dg-do compile } */
2 /* { dg-options "-O2" } */
4 volatile unsigned int w0, w1;
5 volatile int result;
7 void test_si() {
8 /* { dg-final { scan-assembler "tst\tw\[0-9\]*, w\[0-9\]*\n" } } */
9 result = !(w0 & w1);
10 /* { dg-final { scan-assembler "tst\tw\[0-9\]*, \(0x\[0-9a-fA-F\]+\)|\(\[0-9\]+\)" } } */
11 result = !(w0 & 0x00f0);
12 /* { dg-final { scan-assembler "tst\tw\[0-9\]*.*lsl 4" } } */
13 result = !(w0 & (w1 << 4));
16 void test_si_tbnz() {
17 /* { dg-final { scan-assembler "tbnz\t\[wx\]\[0-9\]*" } } */
18 jumpto:
19 if (w0 & 0x08) goto jumpto;
22 void test_si_tbz() {
23 /* { dg-final { scan-assembler "tbz\t\[wx\]\[0-9\]*" } } */
24 jumpto:
25 if (!(w1 & 0x08)) goto jumpto;
28 volatile unsigned long long x0, x1;
30 void test_di() {
31 /* { dg-final { scan-assembler "tst\tx\[0-9\]*, x\[0-9\]*\n" } } */
32 result = !(x0 & x1);
33 /* { dg-final { scan-assembler "tst\tx\[0-9\]*, \(0x\[0-9a-fA-F\]+\)|\(\[0-9\]+\)" } } */
34 result = !(x0 & 0x00f0);
35 /* { dg-final { scan-assembler "tst\tx\[0-9\]*.*lsl 4" } } */
36 result = !(x0 & (x1 << 4));
39 void test_di_tbnz() {
40 /* { dg-final { scan-assembler "tbnz\tx\[0-9\]*" } } */
41 jumpto:
42 if (x0 & 0x08) goto jumpto;
45 void test_di_tbz() {
46 /* { dg-final { scan-assembler "tbz\tx\[0-9\]*" } } */
47 jumpto:
48 if (!(x1 & 0x08)) goto jumpto;