summaryrefslogtreecommitdiff
path: root/test/ASTMerge/macro
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2019-05-14 18:51:07 +0000
committerReid Kleckner <rnk@google.com>2019-05-14 18:51:07 +0000
commit9ea2db92e4180cccb87f78b4d9a7bf0adb430097 (patch)
treeb1dd76395ab5f7fadfda9207cc25806b9f15c217 /test/ASTMerge/macro
parentce15c91f4c4912cc3ea62256557dab8dbe4de7d1 (diff)
downloadclang-9ea2db92e4180cccb87f78b4d9a7bf0adb430097.tar.gz
Restore test files accidentally deleted in r354839
I think there must be a bug in git-llvm causing parent directories to be deleted when the diff deletes files in a subdirectory. Perhaps it is Windows-only. There has been a behavior change, so some of these tests now fail. I have marked them XFAIL and will fix them in a follow-up to separate the changes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360699 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/ASTMerge/macro')
-rw-r--r--test/ASTMerge/macro/Inputs/macro.modulemap4
-rw-r--r--test/ASTMerge/macro/Inputs/macro1.h5
-rw-r--r--test/ASTMerge/macro/Inputs/macro1.m5
-rw-r--r--test/ASTMerge/macro/Inputs/macro2.m5
-rw-r--r--test/ASTMerge/macro/test.m6
5 files changed, 25 insertions, 0 deletions
diff --git a/test/ASTMerge/macro/Inputs/macro.modulemap b/test/ASTMerge/macro/Inputs/macro.modulemap
new file mode 100644
index 0000000000..dba1f2207f
--- /dev/null
+++ b/test/ASTMerge/macro/Inputs/macro.modulemap
@@ -0,0 +1,4 @@
+module macro1 [extern_c] {
+ header "macro1.h"
+ export *
+}
diff --git a/test/ASTMerge/macro/Inputs/macro1.h b/test/ASTMerge/macro/Inputs/macro1.h
new file mode 100644
index 0000000000..9613394967
--- /dev/null
+++ b/test/ASTMerge/macro/Inputs/macro1.h
@@ -0,0 +1,5 @@
+typedef void *VoidRef;
+
+void maybeNull(
+ int i,
+ _Nullable VoidRef *_Nullable);
diff --git a/test/ASTMerge/macro/Inputs/macro1.m b/test/ASTMerge/macro/Inputs/macro1.m
new file mode 100644
index 0000000000..2612613bd0
--- /dev/null
+++ b/test/ASTMerge/macro/Inputs/macro1.m
@@ -0,0 +1,5 @@
+@import macro1;
+
+void foo() {
+ maybeNull(0, 0);
+}
diff --git a/test/ASTMerge/macro/Inputs/macro2.m b/test/ASTMerge/macro/Inputs/macro2.m
new file mode 100644
index 0000000000..b5b155a95b
--- /dev/null
+++ b/test/ASTMerge/macro/Inputs/macro2.m
@@ -0,0 +1,5 @@
+void foo();
+
+void bar() {
+ foo();
+}
diff --git a/test/ASTMerge/macro/test.m b/test/ASTMerge/macro/test.m
new file mode 100644
index 0000000000..77e596d3ba
--- /dev/null
+++ b/test/ASTMerge/macro/test.m
@@ -0,0 +1,6 @@
+// RUN: rm -rf %t
+// RUN: mkdir -p %t/cache
+// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t/cache -fmodule-map-file=%S/Inputs/macro.modulemap -I%S/Inputs -emit-pch -o %t.1.ast %S/Inputs/macro1.m
+// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t/cache -fmodule-map-file=%S/Inputs/macro.modulemap -I%S/Inputs -emit-pch -o %t.2.ast %S/Inputs/macro2.m
+// RUN: %clang_cc1 -fmodules -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only -verify %s
+// expected-no-diagnostics