From 6bbca3411b3861904c3b302f61d59efa14d4d0b9 Mon Sep 17 00:00:00 2001 From: Artem Dergachev Date: Thu, 21 Nov 2019 18:05:19 -0800 Subject: [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 --- clang/test/Analysis/a_flaky_crash.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 clang/test/Analysis/a_flaky_crash.cpp (limited to 'clang') 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}} +} -- cgit v1.2.3