[compiler-rt] r369979 - msan, codegen, instcombine: Keep more lifetime markers used for msan

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 26 15:15:50 PDT 2019


Author: vitalybuka
Date: Mon Aug 26 15:15:50 2019
New Revision: 369979

URL: http://llvm.org/viewvc/llvm-project?rev=369979&view=rev
Log:
msan, codegen, instcombine: Keep more lifetime markers used for msan

Reviewers: eugenis

Subscribers: hiraditya, cfe-commits, #sanitizers, llvm-commits

Tags: #clang, #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D66695

Added:
    compiler-rt/trunk/test/msan/loop-scope.cpp

Added: compiler-rt/trunk/test/msan/loop-scope.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/msan/loop-scope.cpp?rev=369979&view=auto
==============================================================================
--- compiler-rt/trunk/test/msan/loop-scope.cpp (added)
+++ compiler-rt/trunk/test/msan/loop-scope.cpp Mon Aug 26 15:15:50 2019
@@ -0,0 +1,18 @@
+// RUN: %clangxx_msan -O2 %s -o %t && \
+// RUN:     not %run %t 2>&1 | FileCheck %s
+
+#include <stdlib.h>
+
+int *p;
+
+int main() {
+  for (int i = 0; i < 3; i++) {
+    int x;
+    if (i == 0)
+      x = 0;
+    p = &x;
+  }
+  return *p; // BOOM
+  // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value
+  // CHECK:  #0 0x{{.*}} in main {{.*}}loop-scope.cpp:[[@LINE-2]]
+}




More information about the llvm-commits mailing list