[ASTImporter] Add test for IndirectGotoStmt
authorRaphael Isemann <teemperor@gmail.com>
Thu, 16 Aug 2018 18:19:21 +0000 (18:19 +0000)
committerRaphael Isemann <teemperor@gmail.com>
Thu, 16 Aug 2018 18:19:21 +0000 (18:19 +0000)
Reviewers: a.sidorin, martong

Reviewed By: martong

Subscribers: rnkovacs, martong, cfe-commits

Differential Revision: https://reviews.llvm.org/D50813

llvm-svn: 339915

clang/test/Import/indirect-goto/Inputs/F.cpp [new file with mode: 0644]
clang/test/Import/indirect-goto/test.cpp [new file with mode: 0644]

diff --git a/clang/test/Import/indirect-goto/Inputs/F.cpp b/clang/test/Import/indirect-goto/Inputs/F.cpp
new file mode 100644 (file)
index 0000000..368b6db
--- /dev/null
@@ -0,0 +1,6 @@
+void f() {
+  void const *l1_ptr = &&l1;
+  goto *l1_ptr;
+l1:
+  return;
+}
diff --git a/clang/test/Import/indirect-goto/test.cpp b/clang/test/Import/indirect-goto/test.cpp
new file mode 100644 (file)
index 0000000..62be49e
--- /dev/null
@@ -0,0 +1,10 @@
+// RUN: clang-import-test -dump-ast -import %S/Inputs/F.cpp -expression %s | FileCheck %s
+
+// CHECK: IndirectGotoStmt
+// CHECK-NEXT: ImplicitCastExpr
+// CHECK-NEXT: DeclRefExpr
+// CHECK-SAME: 'l1_ptr'
+
+void expr() {
+  f();
+}