[compiler-rt] 20aad43 - [hwasan] [test] fix test broken by argument promotion pass

Florian Mayer via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 14 18:50:59 PDT 2023


Author: Florian Mayer
Date: 2023-04-14T18:50:48-07:00
New Revision: 20aad43b2f3c9c6b1c15be975dfb828b6d798c2b

URL: https://github.com/llvm/llvm-project/commit/20aad43b2f3c9c6b1c15be975dfb828b6d798c2b
DIFF: https://github.com/llvm/llvm-project/commit/20aad43b2f3c9c6b1c15be975dfb828b6d798c2b.diff

LOG: [hwasan] [test] fix test broken by argument promotion pass

Added: 
    

Modified: 
    compiler-rt/test/hwasan/TestCases/use-after-scope-capture.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/hwasan/TestCases/use-after-scope-capture.cpp b/compiler-rt/test/hwasan/TestCases/use-after-scope-capture.cpp
index 5a2d0dc228cd1..a79810ef1db3f 100644
--- a/compiler-rt/test/hwasan/TestCases/use-after-scope-capture.cpp
+++ b/compiler-rt/test/hwasan/TestCases/use-after-scope-capture.cpp
@@ -10,11 +10,13 @@
 int main() {
   std::function<int()> f;
   {
-    int x = 0;
+    volatile int x = 0;
     f = [&x]() __attribute__((noinline)) {
       return x; // BOOM
       // CHECK: ERROR: HWAddressSanitizer: tag-mismatch
-      // CHECK: #0 0x{{.*}} in {{.*}}use-after-scope-capture.cpp:[[@LINE-2]]
+      // We cannot assert the line, after the argument promotion pass this crashes
+      // in the BOOM line below instead, when the ref gets turned into a value.
+      // CHECK: 0x{{.*}} in {{.*}}use-after-scope-capture.cpp
       // CHECK: Cause: stack tag-mismatch
     };
   }


        


More information about the llvm-commits mailing list