From: Florian Mayer Date: Sat, 15 Apr 2023 01:50:22 +0000 (-0700) Subject: [hwasan] [test] fix test broken by argument promotion pass X-Git-Tag: upstream/17.0.6~11524 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=20aad43b2f3c9c6b1c15be975dfb828b6d798c2b;p=platform%2Fupstream%2Fllvm.git [hwasan] [test] fix test broken by argument promotion pass --- 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 5a2d0dc..a79810e 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 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 }; }