]> granicus.if.org Git - clang/commitdiff
[ASTImporter] Add test for CXXScalarValueInit
authorRaphael Isemann <teemperor@gmail.com>
Thu, 16 Aug 2018 01:36:37 +0000 (01:36 +0000)
committerRaphael Isemann <teemperor@gmail.com>
Thu, 16 Aug 2018 01:36:37 +0000 (01:36 +0000)
Reviewers: a.sidorin, a_sidorin

Reviewed By: a_sidorin

Subscribers: martong, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339838 91177308-0d34-0410-b5e6-96231b3b80d8

test/Import/cxx-scalar-value-init/Inputs/S.cpp [new file with mode: 0644]
test/Import/cxx-scalar-value-init/test.cpp [new file with mode: 0644]

diff --git a/test/Import/cxx-scalar-value-init/Inputs/S.cpp b/test/Import/cxx-scalar-value-init/Inputs/S.cpp
new file mode 100644 (file)
index 0000000..153d960
--- /dev/null
@@ -0,0 +1,2 @@
+int si() { return int(); }
+float sf() { return float(); }
diff --git a/test/Import/cxx-scalar-value-init/test.cpp b/test/Import/cxx-scalar-value-init/test.cpp
new file mode 100644 (file)
index 0000000..5967109
--- /dev/null
@@ -0,0 +1,11 @@
+// RUN: clang-import-test -dump-ast -import %S/Inputs/S.cpp -expression %s | FileCheck %s
+// CHECK: CXXScalarValueInitExpr
+// CHECK-SAME: 'int'
+
+// CHECK: CXXScalarValueInitExpr
+// CHECK-SAME: 'float'
+
+void expr() {
+  int i = si();
+  float f = sf();
+}