summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/always_memset.c14
-rw-r--r--test/build.mk3
2 files changed, 12 insertions, 5 deletions
diff --git a/test/always_memset.c b/test/always_memset.c
index eed15cab27..8a022ef8ef 100644
--- a/test/always_memset.c
+++ b/test/always_memset.c
@@ -78,8 +78,13 @@ fake_builtin_memset(char *dest, char c, size_t len)
* functionality.
* - To check how much of the stack |space| was used by the caller,
* run "x/256xb $adr" or "x/64xw $adr" after the memcpy.
+ *
+ * Disable ASAN with the attribute because this function returns a pointer to
+ * stack memory, which is normally very naughty, but is what we want to test
+ * here.
*/
-test_static void exercise_memset(char **p)
+__attribute__((no_sanitize("address"))) test_static void
+exercise_memset(char **p)
{
/*
* Add extra stack space so that |buf| doesn't get trampled while the
@@ -134,8 +139,13 @@ test_static int test_optimization_working(void)
* to optimize out the last memset due to no side effect.
*
* This function layout must remain identical to exercise_memset.
+ *
+ * Disable ASAN with the attribute because this function returns a pointer to
+ * stack memory, which is normally very naughty, but is what we want to test
+ * here.
*/
-test_static void exercise_always_memset(char **p)
+__attribute__((no_sanitize("address"))) test_static void
+exercise_always_memset(char **p)
{
/*
* Add extra stack space so that |buf| doesn't get trampled while the
diff --git a/test/build.mk b/test/build.mk
index e993268143..963882cea2 100644
--- a/test/build.mk
+++ b/test/build.mk
@@ -21,10 +21,7 @@ test-list-host=$(TEST_LIST_HOST)
else
test-list-host = accel_cal
test-list-host += aes
-ifeq ($(TEST_ASAN),)
-# TODO(b/264432260): always_memset fails with TEST_ASAN
test-list-host += always_memset
-endif
test-list-host += base32
test-list-host += battery_get_params_smart
test-list-host += benchmark