diff options
Diffstat (limited to 'clang/test/ASTMerge/macro')
-rw-r--r-- | clang/test/ASTMerge/macro/Inputs/macro.modulemap | 4 | ||||
-rw-r--r-- | clang/test/ASTMerge/macro/Inputs/macro1.h | 5 | ||||
-rw-r--r-- | clang/test/ASTMerge/macro/Inputs/macro1.m | 5 | ||||
-rw-r--r-- | clang/test/ASTMerge/macro/Inputs/macro2.m | 5 | ||||
-rw-r--r-- | clang/test/ASTMerge/macro/test.m | 6 |
5 files changed, 25 insertions, 0 deletions
diff --git a/clang/test/ASTMerge/macro/Inputs/macro.modulemap b/clang/test/ASTMerge/macro/Inputs/macro.modulemap new file mode 100644 index 00000000000..dba1f2207f1 --- /dev/null +++ b/clang/test/ASTMerge/macro/Inputs/macro.modulemap @@ -0,0 +1,4 @@ +module macro1 [extern_c] { + header "macro1.h" + export * +} diff --git a/clang/test/ASTMerge/macro/Inputs/macro1.h b/clang/test/ASTMerge/macro/Inputs/macro1.h new file mode 100644 index 00000000000..96133949678 --- /dev/null +++ b/clang/test/ASTMerge/macro/Inputs/macro1.h @@ -0,0 +1,5 @@ +typedef void *VoidRef; + +void maybeNull( + int i, + _Nullable VoidRef *_Nullable); diff --git a/clang/test/ASTMerge/macro/Inputs/macro1.m b/clang/test/ASTMerge/macro/Inputs/macro1.m new file mode 100644 index 00000000000..2612613bd0b --- /dev/null +++ b/clang/test/ASTMerge/macro/Inputs/macro1.m @@ -0,0 +1,5 @@ +@import macro1; + +void foo() { + maybeNull(0, 0); +} diff --git a/clang/test/ASTMerge/macro/Inputs/macro2.m b/clang/test/ASTMerge/macro/Inputs/macro2.m new file mode 100644 index 00000000000..b5b155a95b5 --- /dev/null +++ b/clang/test/ASTMerge/macro/Inputs/macro2.m @@ -0,0 +1,5 @@ +void foo(); + +void bar() { + foo(); +} diff --git a/clang/test/ASTMerge/macro/test.m b/clang/test/ASTMerge/macro/test.m new file mode 100644 index 00000000000..77e596d3bae --- /dev/null +++ b/clang/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 |