aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/aarch64/tst-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.target/aarch64/tst-1.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/aarch64/tst-1.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/tst-1.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/tst-1.c
new file mode 100644
index 000000000..b37c522e2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/tst-1.c
@@ -0,0 +1,49 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+volatile unsigned int w0, w1;
+volatile int result;
+
+void test_si() {
+ /* { dg-final { scan-assembler "tst\tw\[0-9\]*, w\[0-9\]*\n" } } */
+ result = !(w0 & w1);
+ /* { dg-final { scan-assembler "tst\tw\[0-9\]*, \(0x\[0-9a-fA-F\]+\)|\(\[0-9\]+\)" } } */
+ result = !(w0 & 0x00f0);
+ /* { dg-final { scan-assembler "tst\tw\[0-9\]*.*lsl 4" } } */
+ result = !(w0 & (w1 << 4));
+}
+
+void test_si_tbnz() {
+ /* { dg-final { scan-assembler "tbnz\t\[wx\]\[0-9\]*" } } */
+jumpto:
+ if (w0 & 0x08) goto jumpto;
+}
+
+void test_si_tbz() {
+ /* { dg-final { scan-assembler "tbz\t\[wx\]\[0-9\]*" } } */
+jumpto:
+ if (!(w1 & 0x08)) goto jumpto;
+}
+
+volatile unsigned long long x0, x1;
+
+void test_di() {
+ /* { dg-final { scan-assembler "tst\tx\[0-9\]*, x\[0-9\]*\n" } } */
+ result = !(x0 & x1);
+ /* { dg-final { scan-assembler "tst\tx\[0-9\]*, \(0x\[0-9a-fA-F\]+\)|\(\[0-9\]+\)" } } */
+ result = !(x0 & 0x00f0);
+ /* { dg-final { scan-assembler "tst\tx\[0-9\]*.*lsl 4" } } */
+ result = !(x0 & (x1 << 4));
+}
+
+void test_di_tbnz() {
+ /* { dg-final { scan-assembler "tbnz\tx\[0-9\]*" } } */
+jumpto:
+ if (x0 & 0x08) goto jumpto;
+}
+
+void test_di_tbz() {
+ /* { dg-final { scan-assembler "tbz\tx\[0-9\]*" } } */
+jumpto:
+ if (!(x1 & 0x08)) goto jumpto;
+}