diff options
Diffstat (limited to 'clang/test')
21 files changed, 98 insertions, 0 deletions
diff --git a/clang/test/Modules/Inputs/lookup-assert/Base.h b/clang/test/Modules/Inputs/lookup-assert/Base.h new file mode 100644 index 00000000000..67e66183ca1 --- /dev/null +++ b/clang/test/Modules/Inputs/lookup-assert/Base.h @@ -0,0 +1,3 @@ +@interface BaseInterface +- (void) test; +@end diff --git a/clang/test/Modules/Inputs/lookup-assert/Derive.h b/clang/test/Modules/Inputs/lookup-assert/Derive.h new file mode 100644 index 00000000000..313a96188d2 --- /dev/null +++ b/clang/test/Modules/Inputs/lookup-assert/Derive.h @@ -0,0 +1,3 @@ +#include "Base.h" +@interface DerivedInterface : BaseInterface +@end diff --git a/clang/test/Modules/Inputs/lookup-assert/H3.h b/clang/test/Modules/Inputs/lookup-assert/H3.h new file mode 100644 index 00000000000..3d8f878905d --- /dev/null +++ b/clang/test/Modules/Inputs/lookup-assert/H3.h @@ -0,0 +1 @@ +#include "Base.h" diff --git a/clang/test/Modules/Inputs/lookup-assert/module.map b/clang/test/Modules/Inputs/lookup-assert/module.map new file mode 100644 index 00000000000..e8a89eb095a --- /dev/null +++ b/clang/test/Modules/Inputs/lookup-assert/module.map @@ -0,0 +1,4 @@ +module X { + header "H3.h" + export * +} diff --git a/clang/test/Modules/Inputs/objc-category-2/Base.h b/clang/test/Modules/Inputs/objc-category-2/Base.h new file mode 100644 index 00000000000..9bd8b17a87e --- /dev/null +++ b/clang/test/Modules/Inputs/objc-category-2/Base.h @@ -0,0 +1,3 @@ +@interface DVTSourceModel // expected-error {{duplicate interface definition for class}} \ + // expected-note {{previous definition is here}} +@end diff --git a/clang/test/Modules/Inputs/objc-category-2/Category.h b/clang/test/Modules/Inputs/objc-category-2/Category.h new file mode 100644 index 00000000000..7cde9fb64cc --- /dev/null +++ b/clang/test/Modules/Inputs/objc-category-2/Category.h @@ -0,0 +1,4 @@ +#include "Base.h" +@interface DVTSourceModel(Additions) +- (int)test:(int)item; +@end diff --git a/clang/test/Modules/Inputs/objc-category-2/H3.h b/clang/test/Modules/Inputs/objc-category-2/H3.h new file mode 100644 index 00000000000..3d8f878905d --- /dev/null +++ b/clang/test/Modules/Inputs/objc-category-2/H3.h @@ -0,0 +1 @@ +#include "Base.h" diff --git a/clang/test/Modules/Inputs/objc-category-2/module.map b/clang/test/Modules/Inputs/objc-category-2/module.map new file mode 100644 index 00000000000..833b189a338 --- /dev/null +++ b/clang/test/Modules/Inputs/objc-category-2/module.map @@ -0,0 +1,4 @@ +module X { + header "Category.h" + export * +} diff --git a/clang/test/Modules/Inputs/objc-category-3/Base.h b/clang/test/Modules/Inputs/objc-category-3/Base.h new file mode 100644 index 00000000000..44094643b34 --- /dev/null +++ b/clang/test/Modules/Inputs/objc-category-3/Base.h @@ -0,0 +1,2 @@ +@interface DVTSourceModel +@end diff --git a/clang/test/Modules/Inputs/objc-category-3/Category.h b/clang/test/Modules/Inputs/objc-category-3/Category.h new file mode 100644 index 00000000000..7cde9fb64cc --- /dev/null +++ b/clang/test/Modules/Inputs/objc-category-3/Category.h @@ -0,0 +1,4 @@ +#include "Base.h" +@interface DVTSourceModel(Additions) +- (int)test:(int)item; +@end diff --git a/clang/test/Modules/Inputs/objc-category-3/Category_B.h b/clang/test/Modules/Inputs/objc-category-3/Category_B.h new file mode 100644 index 00000000000..d67f94b3a9c --- /dev/null +++ b/clang/test/Modules/Inputs/objc-category-3/Category_B.h @@ -0,0 +1,4 @@ +#include "Base.h" +@interface DVTSourceModel(AdditionsB) +- (int)testB:(int)item matchingMask:(int)mask; +@end diff --git a/clang/test/Modules/Inputs/objc-category-3/H3.h b/clang/test/Modules/Inputs/objc-category-3/H3.h new file mode 100644 index 00000000000..3d8f878905d --- /dev/null +++ b/clang/test/Modules/Inputs/objc-category-3/H3.h @@ -0,0 +1 @@ +#include "Base.h" diff --git a/clang/test/Modules/Inputs/objc-category-3/module.map b/clang/test/Modules/Inputs/objc-category-3/module.map new file mode 100644 index 00000000000..c53d5dc6efa --- /dev/null +++ b/clang/test/Modules/Inputs/objc-category-3/module.map @@ -0,0 +1,4 @@ +module X { + header "Category_B.h" + export * +} diff --git a/clang/test/Modules/Inputs/objc-category/Base.h b/clang/test/Modules/Inputs/objc-category/Base.h new file mode 100644 index 00000000000..44094643b34 --- /dev/null +++ b/clang/test/Modules/Inputs/objc-category/Base.h @@ -0,0 +1,2 @@ +@interface DVTSourceModel +@end diff --git a/clang/test/Modules/Inputs/objc-category/Category.h b/clang/test/Modules/Inputs/objc-category/Category.h new file mode 100644 index 00000000000..7cde9fb64cc --- /dev/null +++ b/clang/test/Modules/Inputs/objc-category/Category.h @@ -0,0 +1,4 @@ +#include "Base.h" +@interface DVTSourceModel(Additions) +- (int)test:(int)item; +@end diff --git a/clang/test/Modules/Inputs/objc-category/H3.h b/clang/test/Modules/Inputs/objc-category/H3.h new file mode 100644 index 00000000000..3d8f878905d --- /dev/null +++ b/clang/test/Modules/Inputs/objc-category/H3.h @@ -0,0 +1 @@ +#include "Base.h" diff --git a/clang/test/Modules/Inputs/objc-category/module.map b/clang/test/Modules/Inputs/objc-category/module.map new file mode 100644 index 00000000000..e8a89eb095a --- /dev/null +++ b/clang/test/Modules/Inputs/objc-category/module.map @@ -0,0 +1,4 @@ +module X { + header "H3.h" + export * +} diff --git a/clang/test/Modules/lookup-assert.m b/clang/test/Modules/lookup-assert.m new file mode 100644 index 00000000000..2697fb15d01 --- /dev/null +++ b/clang/test/Modules/lookup-assert.m @@ -0,0 +1,10 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -I %S/Inputs/lookup-assert %s -verify +// expected-no-diagnostics + +#include "Derive.h" +#import <H3.h> +@implementation DerivedInterface +- (void)test { +} +@end diff --git a/clang/test/Modules/objc-category-2.m b/clang/test/Modules/objc-category-2.m new file mode 100644 index 00000000000..3a6f52d6105 --- /dev/null +++ b/clang/test/Modules/objc-category-2.m @@ -0,0 +1,12 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -I %S/Inputs/objc-category-2 %s -verify -fobjc-arc + +// We have a definition of category and the base interface imported from a +// module, definition for the base interface is also textually included. +// Currently we emit an error "duplicate interface definition". +#import <Category.h> +#include "H3.h" + +void test(DVTSourceModel *m) { + [m test:1]; +} diff --git a/clang/test/Modules/objc-category-3.m b/clang/test/Modules/objc-category-3.m new file mode 100644 index 00000000000..b5162bffbfe --- /dev/null +++ b/clang/test/Modules/objc-category-3.m @@ -0,0 +1,14 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -I %S/Inputs/objc-category-3 %s -verify -fobjc-arc +// expected-no-diagnostics + +// We have a definition of the base interface textually included from +// Category.h, the definition is also in the module that includes the base +// interface. We should be able to see both categories in the TU. +#include "Category.h" +#import <Category_B.h> + +void test(DVTSourceModel *m) { + [m test:1]; + [m testB:1 matchingMask:2]; +} diff --git a/clang/test/Modules/objc-category.m b/clang/test/Modules/objc-category.m new file mode 100644 index 00000000000..944c7ea625d --- /dev/null +++ b/clang/test/Modules/objc-category.m @@ -0,0 +1,13 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -I %S/Inputs/objc-category %s -verify -fobjc-arc +// expected-no-diagnostics + +// We have a definition of the base interface textually included from +// Category.h, the definition is also in the module that includes the base +// interface. We should be able to see the category in the TU. +#include "Category.h" +#import <H3.h> + +void test(DVTSourceModel *m) { + [m test:1]; +} |