Simplify MemtagNoteTests
It's easier to just disable hwasan than to handle it in the test.
Change-Id: I511c63ae8916e03d33984a749f279fabbd0a75e3
diff --git a/tests/heap_tagging_level_test.cpp b/tests/heap_tagging_level_test.cpp
index a5abb7b..5d85e97 100644
--- a/tests/heap_tagging_level_test.cpp
+++ b/tests/heap_tagging_level_test.cpp
@@ -231,18 +231,13 @@
}
// Note that we do not check running_with_hwasan() - what matters here is whether the test binary
// itself is built with HWASan.
- bool withHWASAN = __has_feature(hwaddress_sanitizer);
bool withMTE = getauxval(AT_HWCAP2) & HWCAP2_MTE;
- const char* kExpectedOutputHWASAN[] = {".*tag-mismatch.*", ".*tag-mismatch.*",
- ".*tag-mismatch.*"};
// Note that we do not check the exact si_code of the "async" variant, as it may be auto-upgraded
// to asymm or even sync.
const char* kExpectedOutputMTE[] = {"normal exit\n", "SEGV_MTE[AS]ERR\n", "SEGV_MTESERR\n"};
const char* kExpectedOutputNonMTE[] = {"normal exit\n", "normal exit\n", "normal exit\n"};
- const char** kExpectedOutput =
- withHWASAN ? kExpectedOutputHWASAN : (withMTE ? kExpectedOutputMTE : kExpectedOutputNonMTE);
- const int kExpectedExitStatus = withHWASAN ? -SIGABRT : 0;
+ const char** kExpectedOutput = withMTE ? kExpectedOutputMTE : kExpectedOutputNonMTE;
MemtagNote note = std::get<0>(GetParam());
bool isStatic = std::get<1>(GetParam());
@@ -252,7 +247,7 @@
chmod(helper.c_str(), 0755);
ExecTestHelper eth;
eth.SetArgs({helper.c_str(), nullptr});
- eth.Run([&]() { execve(helper.c_str(), eth.GetArgs(), eth.GetEnv()); }, kExpectedExitStatus,
+ eth.Run([&]() { execve(helper.c_str(), eth.GetArgs(), eth.GetEnv()); }, 0,
kExpectedOutput[static_cast<int>(note)]);
#else
GTEST_SKIP() << "bionic/arm64 only";
diff --git a/tests/libs/Android.bp b/tests/libs/Android.bp
index a2fbe55..51f5ac6 100644
--- a/tests/libs/Android.bp
+++ b/tests/libs/Android.bp
@@ -1621,6 +1621,7 @@
diag: {
memtag_heap: true,
},
+ hwaddress: false,
},
}
@@ -1633,6 +1634,7 @@
diag: {
memtag_heap: false,
},
+ hwaddress: false,
},
}
@@ -1642,6 +1644,7 @@
srcs: ["heap_tagging_helper.cpp"],
sanitize: {
memtag_heap: false,
+ hwaddress: false,
},
}
@@ -1655,6 +1658,7 @@
diag: {
memtag_heap: true,
},
+ hwaddress: false,
},
}
@@ -1668,6 +1672,7 @@
diag: {
memtag_heap: false,
},
+ hwaddress: false,
},
}
@@ -1678,6 +1683,7 @@
static_executable: true,
sanitize: {
memtag_heap: false,
+ hwaddress: false,
},
}
@@ -1691,6 +1697,7 @@
diag: {
memtag_heap: true,
},
+ hwaddress: false,
},
header_libs: ["bionic_libc_platform_headers"],
cflags: ["-fexceptions"],
@@ -1707,6 +1714,7 @@
diag: {
memtag_heap: true,
},
+ hwaddress: false,
},
header_libs: ["bionic_libc_platform_headers"],
cflags: ["-fexceptions"],