summaryrefslogtreecommitdiff
path: root/clang/test/Analysis/inline3.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Analysis/inline3.c')
-rw-r--r--clang/test/Analysis/inline3.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/Analysis/inline3.c b/clang/test/Analysis/inline3.c
new file mode 100644
index 0000000..968d82a
--- /dev/null
+++ b/clang/test/Analysis/inline3.c
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-ipa=inlining -analyzer-store region -verify %s
+
+// Test when entering f1(), we set the right AnalysisDeclContext to Environment.
+// Otherwise, block-level expr '1 && a' would not be block-level.
+int a;
+
+void f1() {
+ if (1 && a)
+ return;
+}
+
+void f2() {
+ f1();
+}