graydon created this revision. Add a test for the change to ASTReader that reproduces the logic for consolidating multiple ObjC interface definitions to the case of multiple ObjC protocol definitions.
This test is a modified copy of the test that accompanied the original change to interfaces, in 2ba1979. https://reviews.llvm.org/D34788 Files: test/Modules/Inputs/lookup-assert-protocol/Base.h test/Modules/Inputs/lookup-assert-protocol/Derive.h test/Modules/Inputs/lookup-assert-protocol/H3.h test/Modules/Inputs/lookup-assert-protocol/module.map test/Modules/lookup-assert-protocol.m Index: test/Modules/lookup-assert-protocol.m =================================================================== --- /dev/null +++ test/Modules/lookup-assert-protocol.m @@ -0,0 +1,17 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -I %S/Inputs/lookup-assert-protocol %s -verify +// expected-no-diagnostics + +#include "Derive.h" +#import <H3.h> + +__attribute__((objc_root_class)) +@interface Thing<DerivedProtocol> +@end + +@implementation Thing +- (void)test { +} +- (void)test2 { +} +@end Index: test/Modules/Inputs/lookup-assert-protocol/module.map =================================================================== --- /dev/null +++ test/Modules/Inputs/lookup-assert-protocol/module.map @@ -0,0 +1,4 @@ +module X { + header "H3.h" + export * +} Index: test/Modules/Inputs/lookup-assert-protocol/H3.h =================================================================== --- /dev/null +++ test/Modules/Inputs/lookup-assert-protocol/H3.h @@ -0,0 +1 @@ +#include "Base.h" Index: test/Modules/Inputs/lookup-assert-protocol/Derive.h =================================================================== --- /dev/null +++ test/Modules/Inputs/lookup-assert-protocol/Derive.h @@ -0,0 +1,4 @@ +#include "Base.h" +@protocol DerivedProtocol<BaseProtocol> +- (void) test2; +@end Index: test/Modules/Inputs/lookup-assert-protocol/Base.h =================================================================== --- /dev/null +++ test/Modules/Inputs/lookup-assert-protocol/Base.h @@ -0,0 +1,3 @@ +@protocol BaseProtocol +- (void) test; +@end
Index: test/Modules/lookup-assert-protocol.m =================================================================== --- /dev/null +++ test/Modules/lookup-assert-protocol.m @@ -0,0 +1,17 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -I %S/Inputs/lookup-assert-protocol %s -verify +// expected-no-diagnostics + +#include "Derive.h" +#import <H3.h> + +__attribute__((objc_root_class)) +@interface Thing<DerivedProtocol> +@end + +@implementation Thing +- (void)test { +} +- (void)test2 { +} +@end Index: test/Modules/Inputs/lookup-assert-protocol/module.map =================================================================== --- /dev/null +++ test/Modules/Inputs/lookup-assert-protocol/module.map @@ -0,0 +1,4 @@ +module X { + header "H3.h" + export * +} Index: test/Modules/Inputs/lookup-assert-protocol/H3.h =================================================================== --- /dev/null +++ test/Modules/Inputs/lookup-assert-protocol/H3.h @@ -0,0 +1 @@ +#include "Base.h" Index: test/Modules/Inputs/lookup-assert-protocol/Derive.h =================================================================== --- /dev/null +++ test/Modules/Inputs/lookup-assert-protocol/Derive.h @@ -0,0 +1,4 @@ +#include "Base.h" +@protocol DerivedProtocol<BaseProtocol> +- (void) test2; +@end Index: test/Modules/Inputs/lookup-assert-protocol/Base.h =================================================================== --- /dev/null +++ test/Modules/Inputs/lookup-assert-protocol/Base.h @@ -0,0 +1,3 @@ +@protocol BaseProtocol +- (void) test; +@end
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits