summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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