diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:18:08 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:18:08 +0000 |
commit | bab175ec4b075c8076ba14c762900392533f6ee4 (patch) | |
tree | 01f4f29419a2cb10abe13c1e63cd2a66068b0137 /test/ASTMerge | |
parent | 8b7a8012d223fac5d17d16a66bb39168a9a1dfc0 (diff) |
Vendor import of clang trunk r290819:vendor/clang/clang-trunk-r290819
Diffstat (limited to 'test/ASTMerge')
-rw-r--r-- | test/ASTMerge/anonymous-fields/Inputs/anonymous-fields1.cpp (renamed from test/ASTMerge/Inputs/anonymous-fields1.cpp) | 0 | ||||
-rw-r--r-- | test/ASTMerge/anonymous-fields/Inputs/anonymous-fields2.cpp (renamed from test/ASTMerge/Inputs/anonymous-fields2.cpp) | 0 | ||||
-rw-r--r-- | test/ASTMerge/anonymous-fields/test.cpp (renamed from test/ASTMerge/anonymous-fields.cpp) | 0 | ||||
-rw-r--r-- | test/ASTMerge/asm/Inputs/asm-function.cpp | 11 | ||||
-rw-r--r-- | test/ASTMerge/asm/test.cpp | 7 | ||||
-rw-r--r-- | test/ASTMerge/category/Inputs/category1.m (renamed from test/ASTMerge/Inputs/category1.m) | 0 | ||||
-rw-r--r-- | test/ASTMerge/category/Inputs/category2.m (renamed from test/ASTMerge/Inputs/category2.m) | 0 | ||||
-rw-r--r-- | test/ASTMerge/category/test.m (renamed from test/ASTMerge/category.m) | 0 | ||||
-rw-r--r-- | test/ASTMerge/class-template/Inputs/class-template1.cpp (renamed from test/ASTMerge/Inputs/class-template1.cpp) | 0 | ||||
-rw-r--r-- | test/ASTMerge/class-template/Inputs/class-template2.cpp (renamed from test/ASTMerge/Inputs/class-template2.cpp) | 0 | ||||
-rw-r--r-- | test/ASTMerge/class-template/test.cpp (renamed from test/ASTMerge/class-template.cpp) | 0 | ||||
-rw-r--r-- | test/ASTMerge/class/Inputs/class1.cpp (renamed from test/ASTMerge/Inputs/class1.cpp) | 0 | ||||
-rw-r--r-- | test/ASTMerge/class/Inputs/class2.cpp (renamed from test/ASTMerge/Inputs/class2.cpp) | 0 | ||||
-rw-r--r-- | test/ASTMerge/class/test.cpp (renamed from test/ASTMerge/class.cpp) | 0 | ||||
-rw-r--r-- | test/ASTMerge/class2/Inputs/class3.cpp | 26 | ||||
-rw-r--r-- | test/ASTMerge/class2/test.cpp | 9 | ||||
-rw-r--r-- | test/ASTMerge/codegen-body/Inputs/body1.c (renamed from test/ASTMerge/Inputs/body1.c) | 0 | ||||
-rw-r--r-- | test/ASTMerge/codegen-body/Inputs/body2.c (renamed from test/ASTMerge/Inputs/body2.c) | 0 | ||||
-rw-r--r-- | test/ASTMerge/codegen-body/test.c (renamed from test/ASTMerge/codegen-body.c) | 0 | ||||
-rw-r--r-- | test/ASTMerge/codegen-exprs/Inputs/exprs1.c (renamed from test/ASTMerge/Inputs/exprs1.c) | 0 | ||||
-rw-r--r-- | test/ASTMerge/codegen-exprs/Inputs/exprs2.c (renamed from test/ASTMerge/Inputs/exprs2.c) | 0 | ||||
-rw-r--r-- | test/ASTMerge/codegen-exprs/test.c (renamed from test/ASTMerge/codegen-exprs.c) | 0 | ||||
-rw-r--r-- | test/ASTMerge/enum/Inputs/enum1.c (renamed from test/ASTMerge/Inputs/enum1.c) | 0 | ||||
-rw-r--r-- | test/ASTMerge/enum/Inputs/enum2.c (renamed from test/ASTMerge/Inputs/enum2.c) | 0 | ||||
-rw-r--r-- | test/ASTMerge/enum/test.c (renamed from test/ASTMerge/enum.c) | 0 | ||||
-rw-r--r-- | test/ASTMerge/exprs-cpp/Inputs/exprs3.cpp | 120 | ||||
-rw-r--r-- | test/ASTMerge/exprs-cpp/test.cpp | 45 | ||||
-rw-r--r-- | test/ASTMerge/exprs/Inputs/exprs1.c | 10 | ||||
-rw-r--r-- | test/ASTMerge/exprs/Inputs/exprs2.c | 10 | ||||
-rw-r--r-- | test/ASTMerge/exprs/test.c (renamed from test/ASTMerge/exprs.c) | 0 | ||||
-rw-r--r-- | test/ASTMerge/function/Inputs/function1.c (renamed from test/ASTMerge/Inputs/function1.c) | 0 | ||||
-rw-r--r-- | test/ASTMerge/function/Inputs/function2.c (renamed from test/ASTMerge/Inputs/function2.c) | 0 | ||||
-rw-r--r-- | test/ASTMerge/function/test.c (renamed from test/ASTMerge/function.c) | 0 | ||||
-rw-r--r-- | test/ASTMerge/inheritance/Inputs/inheritance-base.cpp (renamed from test/ASTMerge/Inputs/inheritance-base.cpp) | 0 | ||||
-rw-r--r-- | test/ASTMerge/inheritance/test.cpp (renamed from test/ASTMerge/inheritance.cpp) | 0 | ||||
-rw-r--r-- | test/ASTMerge/init-ctors/Inputs/init-ctors-classes.cpp (renamed from test/ASTMerge/Inputs/init-ctors-classes.cpp) | 0 | ||||
-rw-r--r-- | test/ASTMerge/init-ctors/test.cpp (renamed from test/ASTMerge/init-ctors.cpp) | 0 | ||||
-rw-r--r-- | test/ASTMerge/interface/Inputs/interface1.m (renamed from test/ASTMerge/Inputs/interface1.m) | 0 | ||||
-rw-r--r-- | test/ASTMerge/interface/Inputs/interface2.m (renamed from test/ASTMerge/Inputs/interface2.m) | 0 | ||||
-rw-r--r-- | test/ASTMerge/interface/test.m (renamed from test/ASTMerge/interface.m) | 0 | ||||
-rw-r--r-- | test/ASTMerge/macro/Inputs/macro.modulemap | 4 | ||||
-rw-r--r-- | test/ASTMerge/macro/Inputs/macro1.h | 5 | ||||
-rw-r--r-- | test/ASTMerge/macro/Inputs/macro1.m | 5 | ||||
-rw-r--r-- | test/ASTMerge/macro/Inputs/macro2.m | 5 | ||||
-rw-r--r-- | test/ASTMerge/macro/test.m | 6 | ||||
-rw-r--r-- | test/ASTMerge/namespace/Inputs/namespace1.cpp (renamed from test/ASTMerge/Inputs/namespace1.cpp) | 0 | ||||
-rw-r--r-- | test/ASTMerge/namespace/Inputs/namespace2.cpp (renamed from test/ASTMerge/Inputs/namespace2.cpp) | 0 | ||||
-rw-r--r-- | test/ASTMerge/namespace/test.cpp (renamed from test/ASTMerge/namespace.cpp) | 0 | ||||
-rw-r--r-- | test/ASTMerge/property/Inputs/property1.m (renamed from test/ASTMerge/Inputs/property1.m) | 0 | ||||
-rw-r--r-- | test/ASTMerge/property/Inputs/property2.m (renamed from test/ASTMerge/Inputs/property2.m) | 0 | ||||
-rw-r--r-- | test/ASTMerge/property/test.m (renamed from test/ASTMerge/property.m) | 0 | ||||
-rw-r--r-- | test/ASTMerge/struct/Inputs/struct1.c (renamed from test/ASTMerge/Inputs/struct1.c) | 0 | ||||
-rw-r--r-- | test/ASTMerge/struct/Inputs/struct2.c (renamed from test/ASTMerge/Inputs/struct2.c) | 0 | ||||
-rw-r--r-- | test/ASTMerge/struct/test.c (renamed from test/ASTMerge/struct.c) | 0 | ||||
-rw-r--r-- | test/ASTMerge/typedef/Inputs/typedef1.c (renamed from test/ASTMerge/Inputs/typedef1.c) | 0 | ||||
-rw-r--r-- | test/ASTMerge/typedef/Inputs/typedef2.c (renamed from test/ASTMerge/Inputs/typedef2.c) | 0 | ||||
-rw-r--r-- | test/ASTMerge/typedef/test.c (renamed from test/ASTMerge/typedef.c) | 0 | ||||
-rw-r--r-- | test/ASTMerge/var/Inputs/var1.c (renamed from test/ASTMerge/Inputs/var1.c) | 0 | ||||
-rw-r--r-- | test/ASTMerge/var/Inputs/var1.h (renamed from test/ASTMerge/Inputs/var1.h) | 0 | ||||
-rw-r--r-- | test/ASTMerge/var/Inputs/var2.c (renamed from test/ASTMerge/Inputs/var2.c) | 0 | ||||
-rw-r--r-- | test/ASTMerge/var/test.c (renamed from test/ASTMerge/var.c) | 0 |
61 files changed, 263 insertions, 0 deletions
diff --git a/test/ASTMerge/Inputs/anonymous-fields1.cpp b/test/ASTMerge/anonymous-fields/Inputs/anonymous-fields1.cpp index 829bc0edd30a..829bc0edd30a 100644 --- a/test/ASTMerge/Inputs/anonymous-fields1.cpp +++ b/test/ASTMerge/anonymous-fields/Inputs/anonymous-fields1.cpp diff --git a/test/ASTMerge/Inputs/anonymous-fields2.cpp b/test/ASTMerge/anonymous-fields/Inputs/anonymous-fields2.cpp index 28ea46d98711..28ea46d98711 100644 --- a/test/ASTMerge/Inputs/anonymous-fields2.cpp +++ b/test/ASTMerge/anonymous-fields/Inputs/anonymous-fields2.cpp diff --git a/test/ASTMerge/anonymous-fields.cpp b/test/ASTMerge/anonymous-fields/test.cpp index 67afc29d07e5..67afc29d07e5 100644 --- a/test/ASTMerge/anonymous-fields.cpp +++ b/test/ASTMerge/anonymous-fields/test.cpp diff --git a/test/ASTMerge/asm/Inputs/asm-function.cpp b/test/ASTMerge/asm/Inputs/asm-function.cpp new file mode 100644 index 000000000000..59c4edfbcd25 --- /dev/null +++ b/test/ASTMerge/asm/Inputs/asm-function.cpp @@ -0,0 +1,11 @@ + +unsigned char asmFunc(unsigned char a, unsigned char b) { + unsigned int la = a; + unsigned int lb = b; + unsigned int bigres; + unsigned char res; + __asm__ ("0:\n1:\n" : [bigres] "=la"(bigres) : [la] "0"(la), [lb] "c"(lb) : + "edx", "cc"); + res = bigres; + return res; +} diff --git a/test/ASTMerge/asm/test.cpp b/test/ASTMerge/asm/test.cpp new file mode 100644 index 000000000000..3a0a205720fe --- /dev/null +++ b/test/ASTMerge/asm/test.cpp @@ -0,0 +1,7 @@ +// RUN: %clang_cc1 -triple i386-unknown-unknown -fcxx-exceptions -emit-pch -o %t.1.ast %S/Inputs/asm-function.cpp +// RUN: %clang_cc1 -triple i386-unknown-unknown -fcxx-exceptions -ast-merge %t.1.ast -fsyntax-only -verify %s +// expected-no-diagnostics + +void testAsmImport() { + asmFunc(12, 42); +} diff --git a/test/ASTMerge/Inputs/category1.m b/test/ASTMerge/category/Inputs/category1.m index afcaab81f2b7..afcaab81f2b7 100644 --- a/test/ASTMerge/Inputs/category1.m +++ b/test/ASTMerge/category/Inputs/category1.m diff --git a/test/ASTMerge/Inputs/category2.m b/test/ASTMerge/category/Inputs/category2.m index 49a3c270a1c2..49a3c270a1c2 100644 --- a/test/ASTMerge/Inputs/category2.m +++ b/test/ASTMerge/category/Inputs/category2.m diff --git a/test/ASTMerge/category.m b/test/ASTMerge/category/test.m index c7d524816494..c7d524816494 100644 --- a/test/ASTMerge/category.m +++ b/test/ASTMerge/category/test.m diff --git a/test/ASTMerge/Inputs/class-template1.cpp b/test/ASTMerge/class-template/Inputs/class-template1.cpp index 440b5abfc869..440b5abfc869 100644 --- a/test/ASTMerge/Inputs/class-template1.cpp +++ b/test/ASTMerge/class-template/Inputs/class-template1.cpp diff --git a/test/ASTMerge/Inputs/class-template2.cpp b/test/ASTMerge/class-template/Inputs/class-template2.cpp index 6300301a4ffa..6300301a4ffa 100644 --- a/test/ASTMerge/Inputs/class-template2.cpp +++ b/test/ASTMerge/class-template/Inputs/class-template2.cpp diff --git a/test/ASTMerge/class-template.cpp b/test/ASTMerge/class-template/test.cpp index 0ab5443db7f6..0ab5443db7f6 100644 --- a/test/ASTMerge/class-template.cpp +++ b/test/ASTMerge/class-template/test.cpp diff --git a/test/ASTMerge/Inputs/class1.cpp b/test/ASTMerge/class/Inputs/class1.cpp index b0a7645cfe63..b0a7645cfe63 100644 --- a/test/ASTMerge/Inputs/class1.cpp +++ b/test/ASTMerge/class/Inputs/class1.cpp diff --git a/test/ASTMerge/Inputs/class2.cpp b/test/ASTMerge/class/Inputs/class2.cpp index 2bed6d775bc4..2bed6d775bc4 100644 --- a/test/ASTMerge/Inputs/class2.cpp +++ b/test/ASTMerge/class/Inputs/class2.cpp diff --git a/test/ASTMerge/class.cpp b/test/ASTMerge/class/test.cpp index a68a2d1d7690..a68a2d1d7690 100644 --- a/test/ASTMerge/class.cpp +++ b/test/ASTMerge/class/test.cpp diff --git a/test/ASTMerge/class2/Inputs/class3.cpp b/test/ASTMerge/class2/Inputs/class3.cpp new file mode 100644 index 000000000000..428acc3f0319 --- /dev/null +++ b/test/ASTMerge/class2/Inputs/class3.cpp @@ -0,0 +1,26 @@ +class C1 { +public: + C1(); + ~C1(); + C1 *method_1() { + return this; + } + C1 method_2() { + return C1(); + } + void method_3() { + const C1 &ref = C1(); + } +}; + +class C11 : public C1 { +}; + +class C2 { +private: + int x; + friend class C3; +public: + static_assert(sizeof(x) == sizeof(int), "Error"); + typedef class C2::C2 InjType; +}; diff --git a/test/ASTMerge/class2/test.cpp b/test/ASTMerge/class2/test.cpp new file mode 100644 index 000000000000..6021403d7229 --- /dev/null +++ b/test/ASTMerge/class2/test.cpp @@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++1z -emit-pch -o %t.1.ast %S/Inputs/class3.cpp +// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++1z -ast-merge %t.1.ast -fsyntax-only -verify %s +// expected-no-diagnostics + +class C3 { + int method_1(C2 *x) { + return x->x; + } +}; diff --git a/test/ASTMerge/Inputs/body1.c b/test/ASTMerge/codegen-body/Inputs/body1.c index d4d1e4b93781..d4d1e4b93781 100644 --- a/test/ASTMerge/Inputs/body1.c +++ b/test/ASTMerge/codegen-body/Inputs/body1.c diff --git a/test/ASTMerge/Inputs/body2.c b/test/ASTMerge/codegen-body/Inputs/body2.c index 73cb1edf9917..73cb1edf9917 100644 --- a/test/ASTMerge/Inputs/body2.c +++ b/test/ASTMerge/codegen-body/Inputs/body2.c diff --git a/test/ASTMerge/codegen-body.c b/test/ASTMerge/codegen-body/test.c index 7232bf4164b5..7232bf4164b5 100644 --- a/test/ASTMerge/codegen-body.c +++ b/test/ASTMerge/codegen-body/test.c diff --git a/test/ASTMerge/Inputs/exprs1.c b/test/ASTMerge/codegen-exprs/Inputs/exprs1.c index 1c268da15f3d..1c268da15f3d 100644 --- a/test/ASTMerge/Inputs/exprs1.c +++ b/test/ASTMerge/codegen-exprs/Inputs/exprs1.c diff --git a/test/ASTMerge/Inputs/exprs2.c b/test/ASTMerge/codegen-exprs/Inputs/exprs2.c index 1c268da15f3d..1c268da15f3d 100644 --- a/test/ASTMerge/Inputs/exprs2.c +++ b/test/ASTMerge/codegen-exprs/Inputs/exprs2.c diff --git a/test/ASTMerge/codegen-exprs.c b/test/ASTMerge/codegen-exprs/test.c index b5069f993be5..b5069f993be5 100644 --- a/test/ASTMerge/codegen-exprs.c +++ b/test/ASTMerge/codegen-exprs/test.c diff --git a/test/ASTMerge/Inputs/enum1.c b/test/ASTMerge/enum/Inputs/enum1.c index f2b9c5c98fde..f2b9c5c98fde 100644 --- a/test/ASTMerge/Inputs/enum1.c +++ b/test/ASTMerge/enum/Inputs/enum1.c diff --git a/test/ASTMerge/Inputs/enum2.c b/test/ASTMerge/enum/Inputs/enum2.c index 315b4dcb6ef5..315b4dcb6ef5 100644 --- a/test/ASTMerge/Inputs/enum2.c +++ b/test/ASTMerge/enum/Inputs/enum2.c diff --git a/test/ASTMerge/enum.c b/test/ASTMerge/enum/test.c index 7240bcced99e..7240bcced99e 100644 --- a/test/ASTMerge/enum.c +++ b/test/ASTMerge/enum/test.c diff --git a/test/ASTMerge/exprs-cpp/Inputs/exprs3.cpp b/test/ASTMerge/exprs-cpp/Inputs/exprs3.cpp new file mode 100644 index 000000000000..7ed8e338452f --- /dev/null +++ b/test/ASTMerge/exprs-cpp/Inputs/exprs3.cpp @@ -0,0 +1,120 @@ +// Integer literals +const char Ch1 = 'a'; +const signed char Ch2 = 'b'; +const unsigned char Ch3 = 'c'; + +const wchar_t Ch4 = L'd'; +const signed wchar_t Ch5 = L'e'; +const unsigned wchar_t Ch6 = L'f'; + +const short C1 = 12; +const unsigned short C2 = 13; + +const int C3 = 12; +const unsigned int C4 = 13; + +const long C5 = 22; +const unsigned long C6 = 23; + +const long long C7 = 66; +const unsigned long long C8 = 67; + + +// String literals +const char str1[] = "ABCD"; +const char str2[] = "ABCD" "0123"; + +const wchar_t wstr1[] = L"DEF"; +const wchar_t wstr2[] = L"DEF" L"123"; + + +// Boolean literals +const bool bval1 = true; +const bool bval2 = false; + +// Floating Literals +const float F1 = 12.2F; +const double F2 = 1E4; +const long double F3 = 1.2E-3L; + + +// nullptr literal +const void *vptr = nullptr; + + +int glb_1[4] = { 10, 20, 30, 40 }; + +struct S1 { + int a; + int b[3]; +}; + +struct S2 { + int c; + S1 d; +}; + +S2 glb_2 = { 22, .d.a = 44, .d.b[0] = 55, .d.b[1] = 66 }; + +void testNewThrowDelete() { + throw; + char *p = new char[10]; + delete[] p; +} + +int testArrayElement(int *x, int n) { + return x[n]; +} + +int testTernaryOp(int c, int x, int y) { + return c ? x : y; +} + +S1 &testConstCast(const S1 &x) { + return const_cast<S1&>(x); +} + +S1 &testStaticCast(S1 &x) { + return static_cast<S1&>(x); +} + +S1 &testReinterpretCast(S1 &x) { + return reinterpret_cast<S1&>(x); +} + +S1 &testDynamicCast(S1 &x) { + return dynamic_cast<S1&>(x); +} + +int testScalarInit(int x) { + return int(x); +} + +struct S { + float f; + double d; +}; +struct T { + int i; + struct S s[10]; +}; + +void testOffsetOf() { + __builtin_offsetof(struct T, s[2].d); +} + + +int testDefaultArg(int a = 2*2) { + return a; +} + +template <typename T> // T has TemplateTypeParmType +void testTemplateTypeParmType(int i); + +void useTemplateType() { + testTemplateTypeParmType<char>(4); +} + +const bool ExpressionTrait = __is_lvalue_expr(1); +const unsigned ArrayRank = __array_rank(int[10][20]); +const unsigned ArrayExtent = __array_extent(int[10][20], 1); diff --git a/test/ASTMerge/exprs-cpp/test.cpp b/test/ASTMerge/exprs-cpp/test.cpp new file mode 100644 index 000000000000..ba1f18b2c90c --- /dev/null +++ b/test/ASTMerge/exprs-cpp/test.cpp @@ -0,0 +1,45 @@ +// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++1z -fcxx-exceptions -emit-pch -o %t.1.ast %S/Inputs/exprs3.cpp +// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++1z -fcxx-exceptions -ast-merge %t.1.ast -fsyntax-only -verify %s +// expected-no-diagnostics + +static_assert(Ch1 == 'a'); +static_assert(Ch2 == 'b'); +static_assert(Ch3 == 'c'); + +static_assert(Ch4 == L'd'); +static_assert(Ch5 == L'e'); +static_assert(Ch6 == L'f'); + +static_assert(C1 == 12); +static_assert(C2 == 13); + +static_assert(C3 == 12); +static_assert(C4 == 13); + +static_assert(C5 == 22L); +static_assert(C6 == 23L); + +static_assert(C7 == 66LL); +static_assert(C8 == 67ULL); + +static_assert(bval1 == true); +static_assert(bval2 == false); + +static_assert(ExpressionTrait == false); + +static_assert(ArrayRank == 2); +static_assert(ArrayExtent == 20); + +void testImport(int *x, const S1 &cs1, S1 &s1) { + testNewThrowDelete(); + testArrayElement(nullptr, 12); + testTernaryOp(0, 1, 2); + testConstCast(cs1); + testStaticCast(s1); + testReinterpretCast(s1); + testDynamicCast(s1); + testScalarInit(42); + testOffsetOf(); + testDefaultArg(12); + useTemplateType(); +} diff --git a/test/ASTMerge/exprs/Inputs/exprs1.c b/test/ASTMerge/exprs/Inputs/exprs1.c new file mode 100644 index 000000000000..1c268da15f3d --- /dev/null +++ b/test/ASTMerge/exprs/Inputs/exprs1.c @@ -0,0 +1,10 @@ +// Matching +enum E0 { + E0_Val0 = 'a', + E0_Val1 = (17), + E0_Val2 = (1 << 2), + E0_Val3 = E0_Val2, + E0_Val4 = sizeof(int*), + E0_Val5 = (unsigned int)-1 +}; + diff --git a/test/ASTMerge/exprs/Inputs/exprs2.c b/test/ASTMerge/exprs/Inputs/exprs2.c new file mode 100644 index 000000000000..1c268da15f3d --- /dev/null +++ b/test/ASTMerge/exprs/Inputs/exprs2.c @@ -0,0 +1,10 @@ +// Matching +enum E0 { + E0_Val0 = 'a', + E0_Val1 = (17), + E0_Val2 = (1 << 2), + E0_Val3 = E0_Val2, + E0_Val4 = sizeof(int*), + E0_Val5 = (unsigned int)-1 +}; + diff --git a/test/ASTMerge/exprs.c b/test/ASTMerge/exprs/test.c index 7495bb6a874a..7495bb6a874a 100644 --- a/test/ASTMerge/exprs.c +++ b/test/ASTMerge/exprs/test.c diff --git a/test/ASTMerge/Inputs/function1.c b/test/ASTMerge/function/Inputs/function1.c index 4523bd3d79bf..4523bd3d79bf 100644 --- a/test/ASTMerge/Inputs/function1.c +++ b/test/ASTMerge/function/Inputs/function1.c diff --git a/test/ASTMerge/Inputs/function2.c b/test/ASTMerge/function/Inputs/function2.c index 6ca810a6f20b..6ca810a6f20b 100644 --- a/test/ASTMerge/Inputs/function2.c +++ b/test/ASTMerge/function/Inputs/function2.c diff --git a/test/ASTMerge/function.c b/test/ASTMerge/function/test.c index 650f719d1fa8..650f719d1fa8 100644 --- a/test/ASTMerge/function.c +++ b/test/ASTMerge/function/test.c diff --git a/test/ASTMerge/Inputs/inheritance-base.cpp b/test/ASTMerge/inheritance/Inputs/inheritance-base.cpp index 26fe42eb64da..26fe42eb64da 100644 --- a/test/ASTMerge/Inputs/inheritance-base.cpp +++ b/test/ASTMerge/inheritance/Inputs/inheritance-base.cpp diff --git a/test/ASTMerge/inheritance.cpp b/test/ASTMerge/inheritance/test.cpp index 7fce82a736ab..7fce82a736ab 100644 --- a/test/ASTMerge/inheritance.cpp +++ b/test/ASTMerge/inheritance/test.cpp diff --git a/test/ASTMerge/Inputs/init-ctors-classes.cpp b/test/ASTMerge/init-ctors/Inputs/init-ctors-classes.cpp index fd51f860634b..fd51f860634b 100644 --- a/test/ASTMerge/Inputs/init-ctors-classes.cpp +++ b/test/ASTMerge/init-ctors/Inputs/init-ctors-classes.cpp diff --git a/test/ASTMerge/init-ctors.cpp b/test/ASTMerge/init-ctors/test.cpp index 5f0ba4decd9f..5f0ba4decd9f 100644 --- a/test/ASTMerge/init-ctors.cpp +++ b/test/ASTMerge/init-ctors/test.cpp diff --git a/test/ASTMerge/Inputs/interface1.m b/test/ASTMerge/interface/Inputs/interface1.m index 5865c0eff070..5865c0eff070 100644 --- a/test/ASTMerge/Inputs/interface1.m +++ b/test/ASTMerge/interface/Inputs/interface1.m diff --git a/test/ASTMerge/Inputs/interface2.m b/test/ASTMerge/interface/Inputs/interface2.m index 2133bd1381aa..2133bd1381aa 100644 --- a/test/ASTMerge/Inputs/interface2.m +++ b/test/ASTMerge/interface/Inputs/interface2.m diff --git a/test/ASTMerge/interface.m b/test/ASTMerge/interface/test.m index 8ba5d73753a3..8ba5d73753a3 100644 --- a/test/ASTMerge/interface.m +++ b/test/ASTMerge/interface/test.m diff --git a/test/ASTMerge/macro/Inputs/macro.modulemap b/test/ASTMerge/macro/Inputs/macro.modulemap new file mode 100644 index 000000000000..dba1f2207f15 --- /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 000000000000..961339496787 --- /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 000000000000..2612613bd0be --- /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 000000000000..b5b155a95b52 --- /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 000000000000..77e596d3baed --- /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 diff --git a/test/ASTMerge/Inputs/namespace1.cpp b/test/ASTMerge/namespace/Inputs/namespace1.cpp index 1ff84f3111c9..1ff84f3111c9 100644 --- a/test/ASTMerge/Inputs/namespace1.cpp +++ b/test/ASTMerge/namespace/Inputs/namespace1.cpp diff --git a/test/ASTMerge/Inputs/namespace2.cpp b/test/ASTMerge/namespace/Inputs/namespace2.cpp index 80429f700b13..80429f700b13 100644 --- a/test/ASTMerge/Inputs/namespace2.cpp +++ b/test/ASTMerge/namespace/Inputs/namespace2.cpp diff --git a/test/ASTMerge/namespace.cpp b/test/ASTMerge/namespace/test.cpp index 8cc0fa2a6d97..8cc0fa2a6d97 100644 --- a/test/ASTMerge/namespace.cpp +++ b/test/ASTMerge/namespace/test.cpp diff --git a/test/ASTMerge/Inputs/property1.m b/test/ASTMerge/property/Inputs/property1.m index 22fe0a02220c..22fe0a02220c 100644 --- a/test/ASTMerge/Inputs/property1.m +++ b/test/ASTMerge/property/Inputs/property1.m diff --git a/test/ASTMerge/Inputs/property2.m b/test/ASTMerge/property/Inputs/property2.m index 64a03fb04ec3..64a03fb04ec3 100644 --- a/test/ASTMerge/Inputs/property2.m +++ b/test/ASTMerge/property/Inputs/property2.m diff --git a/test/ASTMerge/property.m b/test/ASTMerge/property/test.m index 494802347696..494802347696 100644 --- a/test/ASTMerge/property.m +++ b/test/ASTMerge/property/test.m diff --git a/test/ASTMerge/Inputs/struct1.c b/test/ASTMerge/struct/Inputs/struct1.c index af2af8abc42a..af2af8abc42a 100644 --- a/test/ASTMerge/Inputs/struct1.c +++ b/test/ASTMerge/struct/Inputs/struct1.c diff --git a/test/ASTMerge/Inputs/struct2.c b/test/ASTMerge/struct/Inputs/struct2.c index 4b43df71d8d6..4b43df71d8d6 100644 --- a/test/ASTMerge/Inputs/struct2.c +++ b/test/ASTMerge/struct/Inputs/struct2.c diff --git a/test/ASTMerge/struct.c b/test/ASTMerge/struct/test.c index 4f41cea26b18..4f41cea26b18 100644 --- a/test/ASTMerge/struct.c +++ b/test/ASTMerge/struct/test.c diff --git a/test/ASTMerge/Inputs/typedef1.c b/test/ASTMerge/typedef/Inputs/typedef1.c index 56576756856d..56576756856d 100644 --- a/test/ASTMerge/Inputs/typedef1.c +++ b/test/ASTMerge/typedef/Inputs/typedef1.c diff --git a/test/ASTMerge/Inputs/typedef2.c b/test/ASTMerge/typedef/Inputs/typedef2.c index 129d7101e91e..129d7101e91e 100644 --- a/test/ASTMerge/Inputs/typedef2.c +++ b/test/ASTMerge/typedef/Inputs/typedef2.c diff --git a/test/ASTMerge/typedef.c b/test/ASTMerge/typedef/test.c index 79e472311874..79e472311874 100644 --- a/test/ASTMerge/typedef.c +++ b/test/ASTMerge/typedef/test.c diff --git a/test/ASTMerge/Inputs/var1.c b/test/ASTMerge/var/Inputs/var1.c index 4f5cbe16ab6c..4f5cbe16ab6c 100644 --- a/test/ASTMerge/Inputs/var1.c +++ b/test/ASTMerge/var/Inputs/var1.c diff --git a/test/ASTMerge/Inputs/var1.h b/test/ASTMerge/var/Inputs/var1.h index 1518e17ef0c8..1518e17ef0c8 100644 --- a/test/ASTMerge/Inputs/var1.h +++ b/test/ASTMerge/var/Inputs/var1.h diff --git a/test/ASTMerge/Inputs/var2.c b/test/ASTMerge/var/Inputs/var2.c index 01986e4208ca..01986e4208ca 100644 --- a/test/ASTMerge/Inputs/var2.c +++ b/test/ASTMerge/var/Inputs/var2.c diff --git a/test/ASTMerge/var.c b/test/ASTMerge/var/test.c index e14dc37edac7..e14dc37edac7 100644 --- a/test/ASTMerge/var.c +++ b/test/ASTMerge/var/test.c |