summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorArtem Dergachev <artem.dergachev@gmail.com>2019-11-21 18:05:19 -0800
committerArtem Dergachev <artem.dergachev@gmail.com>2019-11-21 18:11:15 -0800
commit6bbca3411b3861904c3b302f61d59efa14d4d0b9 (patch)
tree2c32af5937940b04d82c6f1713aa5df3523ec622 /clang
parent22a0edd070e4a40447e0dd2699bebfd01de7a5ab (diff)
downloadbcm5719-llvm-6bbca3411b3861904c3b302f61d59efa14d4d0b9.tar.gz
bcm5719-llvm-6bbca3411b3861904c3b302f61d59efa14d4d0b9.zip
[CFG] Add a test for a flaky crash in CFGBlock::getLastCondition().
Push the test separately ahead of time in order to find out whether our Memory Sanitizer bots will be able to find the problem. If not, I'll add a much more expensive test that repeats the current test multiple times in order to show up on normal buildbots. I really apologize for the potential temporary inconvenience! I'll commit the fix as soon as I get the signal. Differential Revision: https://reviews.llvm.org/D69962
Diffstat (limited to 'clang')
-rw-r--r--clang/test/Analysis/a_flaky_crash.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/Analysis/a_flaky_crash.cpp b/clang/test/Analysis/a_flaky_crash.cpp
new file mode 100644
index 00000000000..e0bcc005746
--- /dev/null
+++ b/clang/test/Analysis/a_flaky_crash.cpp
@@ -0,0 +1,15 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+
+struct S {
+ S();
+ ~S();
+};
+
+bool bar(S);
+
+// no-crash during diagnostic construction.
+void foo() {
+ int x;
+ if (true && bar(S()))
+ ++x; // expected-warning{{The expression is an uninitialized value. The computed value will also be garbage}}
+}
OpenPOWER on IntegriCloud