Mercurial > hg > CbC > CbC_llvm
annotate compiler-rt/test/msan/loop-scope.cpp @ 222:81f6424ef0e3 llvm-original
LLVM original branch
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 18 Jul 2021 22:10:01 +0900 |
parents | 1d019706d866 |
children |
rev | line source |
---|---|
150 | 1 // RUN: %clangxx_msan -O2 %s -o %t && \ |
2 // RUN: not %run %t 2>&1 | FileCheck %s | |
3 | |
4 #include <stdlib.h> | |
5 | |
6 int *p; | |
7 | |
8 int main() { | |
9 for (int i = 0; i < 3; i++) { | |
10 int x; | |
11 if (i == 0) | |
12 x = 0; | |
13 p = &x; | |
14 } | |
15 return *p; // BOOM | |
16 // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value | |
17 // CHECK: #0 0x{{.*}} in main {{.*}}loop-scope.cpp:[[@LINE-2]] | |
18 } |