aboutsummaryrefslogtreecommitdiff
path: root/test/Analysis/lambdas.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2012-04-12 20:34:52 +0000
committerTed Kremenek <kremenek@apple.com>2012-04-12 20:34:52 +0000
commit83748e2f41ea0ac7c954946feb5da9ccc6ab8bec (patch)
tree82395d87506922fc8b6a9664d0bf01650d2a9dd6 /test/Analysis/lambdas.cpp
parentc02af35e92909d672b67efee407d2cee6d6d86e5 (diff)
Include lambda capture init expressions in CFG.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154611 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/lambdas.cpp')
-rw-r--r--test/Analysis/lambdas.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/Analysis/lambdas.cpp b/test/Analysis/lambdas.cpp
new file mode 100644
index 0000000000..77b36c42cf
--- /dev/null
+++ b/test/Analysis/lambdas.cpp
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only -analyze -analyzer-checker=debug.DumpCFG %s > %t 2>&1
+// RUN: FileCheck --input-file=%t %s
+
+struct X { X(const X&); };
+void f(X x) { (void) [x]{}; }
+
+// CHECK: [B2 (ENTRY)]
+// CHECK: Succs (1): B1
+// CHECK: [B1]
+// CHECK: 1: x
+// CHECK: 2: [B1.1] (ImplicitCastExpr, NoOp, const struct X)
+// CHECK: 3: [B1.2] (CXXConstructExpr, struct X)
+// CHECK: 4: [=x] {
+// CHECK: }
+// CHECK: 5: (void)[B1.4] (CStyleCastExpr, ToVoid, void)
+// CHECK: Preds (1): B2
+// CHECK: Succs (1): B0
+// CHECK: [B0 (EXIT)]
+// CHECK: Preds (1): B1
+