[compiler-rt] 0e215e0 - Revert "[HWASan] unflake test"
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Tue May 23 11:08:00 PDT 2023
Author: Vitaly Buka
Date: 2023-05-23T11:07:46-07:00
New Revision: 0e215e095f6ca0705c5aad4cbc61aaedec1a9e31
URL: https://github.com/llvm/llvm-project/commit/0e215e095f6ca0705c5aad4cbc61aaedec1a9e31
DIFF: https://github.com/llvm/llvm-project/commit/0e215e095f6ca0705c5aad4cbc61aaedec1a9e31.diff
LOG: Revert "[HWASan] unflake test"
https://reviews.llvm.org/D150742 is the fix.
This reverts commit edd0981e71af87a686365d40e6410a8a377c153d.
Added:
Modified:
compiler-rt/test/hwasan/TestCases/global-with-reduction.c
Removed:
################################################################################
diff --git a/compiler-rt/test/hwasan/TestCases/global-with-reduction.c b/compiler-rt/test/hwasan/TestCases/global-with-reduction.c
index b93e976c6f3ff..de682030ee883 100644
--- a/compiler-rt/test/hwasan/TestCases/global-with-reduction.c
+++ b/compiler-rt/test/hwasan/TestCases/global-with-reduction.c
@@ -22,36 +22,29 @@
// REQUIRES: pointer-tagging
-#include <inttypes.h>
#include <stdlib.h>
-struct data {
- uint64_t x;
- uint64_t y;
-};
-
// GlobalOpt may replace the current GV with a new boolean-typed GV. Previously,
// this resulted in the "nosanitize" getting dropped because while the data/code
// references to the GV were updated, the old metadata references weren't.
-struct data *f() {
+int* f() {
#ifdef USE_NOSANITIZE
- __attribute__((no_sanitize("hwaddress"))) static struct data x = {1, 0};
+__attribute__((no_sanitize("hwaddress"))) static int x = 1;
#else // USE_NOSANITIZE
- static struct data x = {1, 0};
+ static int x = 1;
#endif // USE_NOSANITIZE
- if (x.x == 1)
- x.x = 0;
+ if (x == 1) x = 0;
return &x;
}
int main(int argc, char **argv) {
// CHECK: Cause: global-overflow
- // RSYM: is located 0 bytes after a 16-byte global variable f.x {{.*}} in {{.*}}global-with-reduction.c.tmp
- // RNOSYM: is located after a 16-byte global variable in
+ // RSYM: is located 0 bytes after a 4-byte global variable f.x {{.*}} in {{.*}}global-with-reduction.c.tmp
+ // RNOSYM: is located after a 4-byte global variable in
// RNOSYM-NEXT: #0 0x{{.*}} ({{.*}}global-with-reduction.c.tmp+{{.*}})
- // LSYM: is located 16 bytes before a 16-byte global variable f.x {{.*}} in {{.*}}global-with-reduction.c.tmp
- // LNOSYM: is located before a 16-byte global variable in
+ // LSYM: is located 4 bytes before a 4-byte global variable f.x {{.*}} in {{.*}}global-with-reduction.c.tmp
+ // LNOSYM: is located before a 4-byte global variable in
// LNOSYM-NEXT: #0 0x{{.*}} ({{.*}}global-with-reduction.c.tmp+{{.*}})
// CHECK-NOT: can not describe
- f()[atoi(argv[1])].x = 1;
+ f()[atoi(argv[1])] = 1;
}
More information about the llvm-commits
mailing list