Skip BTI tests on hardware.
Previously, we would hit a VIXL_UNIMPLEMENTED, but this appears as a
test failure. Instead, use the "SKIPPED" marker, which is detected and
presented by `test.py`.
diff --git a/test/aarch64/test-assembler-aarch64.cc b/test/aarch64/test-assembler-aarch64.cc
index 7066ed1..6f7edb9 100644
--- a/test/aarch64/test-assembler-aarch64.cc
+++ b/test/aarch64/test-assembler-aarch64.cc
@@ -2647,13 +2647,18 @@
if (CAN_RUN()) {
#ifdef VIXL_INCLUDE_SIMULATOR_AARCH64
simulator.SetGuardedPages(true);
-#else
- VIXL_UNIMPLEMENTED();
#endif
+ // On hardware, we'll run the test anyway, but mark it as SKIPPED until
+ // we've implemented a mechanism for marking Guarded pages.
+
RUN();
ASSERT_EQUAL_64(42, x0);
ASSERT_EQUAL_64(84, x1);
+
+#ifndef VIXL_INCLUDE_SIMULATOR_AARCH64
+ printf("SKIPPED: marking guarded pages is unimplemented on hardware");
+#endif
}
}
@@ -2686,7 +2691,11 @@
END();
if (CAN_RUN()) {
+#ifdef VIXL_INCLUDE_SIMULATOR_AARCH64
MUST_FAIL_WITH_MESSAGE(RUN(), "Failed to authenticate pointer.");
+#else
+ printf("SKIPPED: negative PAuth tests are unimplemented on hardware.");
+#endif
}
}
#endif // VIXL_NEGATIVE_TESTING
@@ -2722,7 +2731,11 @@
END();
if (CAN_RUN()) {
+#ifdef VIXL_INCLUDE_SIMULATOR_AARCH64
MUST_FAIL_WITH_MESSAGE(RUN(), "Failed to authenticate pointer.");
+#else
+ printf("SKIPPED: negative PAuth tests are unimplemented on hardware.");
+#endif
}
}
#endif // VIXL_NEGATIVE_TESTING
@@ -3725,7 +3738,11 @@
END();
if (CAN_RUN()) {
+#ifdef VIXL_INCLUDE_SIMULATOR_AARCH64
MUST_FAIL_WITH_MESSAGE(RUN(), "Failed to authenticate pointer.");
+#else
+ printf("SKIPPED: negative PAuth tests are unimplemented on hardware.");
+#endif
}
}
#endif // VIXL_NEGATIVE_TESTING
@@ -7632,10 +7649,15 @@
if (CAN_RUN()) {
#ifdef VIXL_INCLUDE_SIMULATOR_AARCH64
simulator.SetGuardedPages(true);
-#else
- VIXL_UNIMPLEMENTED();
#endif
+ // On hardware, we'll run the test anyway, but mark it as SKIPPED until
+ // we've implemented a mechanism for marking Guarded pages.
+
RUN();
+
+#ifndef VIXL_INCLUDE_SIMULATOR_AARCH64
+ printf("SKIPPED: marking guarded pages is unimplemented on hardware");
+#endif
}
}
@@ -7684,8 +7706,6 @@
if (CAN_RUN()) {
#ifdef VIXL_INCLUDE_SIMULATOR_AARCH64
simulator.SetGuardedPages(false);
-#else
- VIXL_UNIMPLEMENTED();
#endif
RUN();
}
@@ -7709,12 +7729,12 @@
if (CAN_RUN()) {
#ifdef VIXL_INCLUDE_SIMULATOR_AARCH64
simulator.SetGuardedPages(true);
-#else
- VIXL_UNIMPLEMENTED();
-#endif
MUST_FAIL_WITH_MESSAGE(RUN(),
"Executing non-BTI instruction with wrong "
"BType.");
+#else
+ printf("SKIPPED: marking guarded pages is unimplemented on hardware");
+#endif
}
}
@@ -7733,12 +7753,12 @@
if (CAN_RUN()) {
#ifdef VIXL_INCLUDE_SIMULATOR_AARCH64
simulator.SetGuardedPages(true);
-#else
- VIXL_UNIMPLEMENTED();
-#endif
MUST_FAIL_WITH_MESSAGE(RUN(),
"Executing non-BTI instruction with wrong "
"BType.");
+#else
+ printf("SKIPPED: marking guarded pages is unimplemented on hardware");
+#endif
}
}
@@ -7757,12 +7777,12 @@
if (CAN_RUN()) {
#ifdef VIXL_INCLUDE_SIMULATOR_AARCH64
simulator.SetGuardedPages(true);
-#else
- VIXL_UNIMPLEMENTED();
-#endif
MUST_FAIL_WITH_MESSAGE(RUN(),
"Executing non-BTI instruction with wrong "
"BType.");
+#else
+ printf("SKIPPED: marking guarded pages is unimplemented on hardware");
+#endif
}
}
@@ -7782,10 +7802,10 @@
if (CAN_RUN()) {
#ifdef VIXL_INCLUDE_SIMULATOR_AARCH64
simulator.SetGuardedPages(true);
-#else
- VIXL_UNIMPLEMENTED();
-#endif
MUST_FAIL_WITH_MESSAGE(RUN(), "Executing BTI c with wrong BType.");
+#else
+ printf("SKIPPED: marking guarded pages is unimplemented on hardware");
+#endif
}
}
@@ -7805,10 +7825,10 @@
if (CAN_RUN()) {
#ifdef VIXL_INCLUDE_SIMULATOR_AARCH64
simulator.SetGuardedPages(true);
-#else
- VIXL_UNIMPLEMENTED();
-#endif
MUST_FAIL_WITH_MESSAGE(RUN(), "Executing BTI j with wrong BType.");
+#else
+ printf("SKIPPED: marking guarded pages is unimplemented on hardware");
+#endif
}
}
#endif // VIXL_NEGATIVE_TESTING
@@ -7833,12 +7853,17 @@
if (CAN_RUN()) {
#ifdef VIXL_INCLUDE_SIMULATOR_AARCH64
simulator.SetGuardedPages(true);
-#else
- VIXL_UNIMPLEMENTED();
#endif
+ // On hardware, we'll run the test anyway, but mark it as SKIPPED until
+ // we've implemented a mechanism for marking Guarded pages.
+
RUN();
ASSERT_EQUAL_64(4, x0);
+
+#ifndef VIXL_INCLUDE_SIMULATOR_AARCH64
+ printf("SKIPPED: marking guarded pages is unimplemented on hardware");
+#endif
}
}