// UNSUPPORTED: -zos, -aix
// RUN: rm -rf %t
// RUN: split-file %s %t
// RUN: %clang_cc1 -fsyntax-only -fobjc-runtime=macosx-10.9 -verify -I%t/include %t/test-mismatch-in-extension.m
// RUN: %clang_cc1 -fsyntax-only -fobjc-runtime=macosx-10.9 -verify -I%t/include %t/test-mismatch-in-extension.m \
// RUN: -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/modules.cache
// RUN: %clang_cc1 -fsyntax-only -fobjc-runtime=macosx-10.9 -verify -I%t/include %t/test-mismatch-in-ivars-number.m
// RUN: %clang_cc1 -fsyntax-only -fobjc-runtime=macosx-10.9 -verify -I%t/include %t/test-mismatch-in-ivars-number.m \
// RUN: -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/modules.cache
// RUN: %clang_cc1 -fsyntax-only -fobjc-runtime=macosx-10.9 -verify -I%t/include %t/test-mismatch-in-methods-protocols.m
// RUN: %clang_cc1 -fsyntax-only -fobjc-runtime=macosx-10.9 -verify -I%t/include %t/test-mismatch-in-methods-protocols.m \
// RUN: -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/modules.cache
// RUN: %clang_cc1 -fsyntax-only -fobjc-runtime=macosx-10.9 -verify -I%t/include %t/test-redecl-in-subclass.m
// RUN: %clang_cc1 -fsyntax-only -fobjc-runtime=macosx-10.9 -verify -I%t/include %t/test-redecl-in-subclass.m \
// RUN: -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/modules.cache
// RUN: %clang_cc1 -fsyntax-only -fobjc-runtime=macosx-10.9 -verify -I%t/include %t/test-redecl-in-implementation.m
// RUN: %clang_cc1 -fsyntax-only -fobjc-runtime=macosx-10.9 -verify -I%t/include %t/test-redecl-in-implementation.m \
// RUN: -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/modules.cache
// Same class extensions with the same ivars but from different modules aren't considered
// an error and they are merged together. Test that differences in extensions and/or ivars
// are still reported as errors.
//--- include/Interfaces.h
//--- include/IvarsInExtensions.h
//--- include/IvarsInExtensionsWithMethodsProtocols.h
//--- include/IvarInImplementation.h
//--- include/module.modulemap
module Interfaces
module IvarsInExtensions
module IvarsInExtensionsWithMethodsProtocols
module IvarInImplementation
//--- test-mismatch-in-extension.m
// Different ivars with the same name aren't mergeable and constitute an error.
// expected-error@IvarsInExtensions.h:* {{instance variable is already declared}}
// expected-error@IvarsInExtensions.h:* {{instance variable is already declared}}
//--- test-mismatch-in-ivars-number.m
// Extensions with different amount of ivars aren't considered to be the same.
// expected-error@IvarsInExtensions.h:* {{instance variable is already declared}}
//--- test-mismatch-in-methods-protocols.m
// Extensions with different methods or protocols aren't considered to be the same.
// expected-error@IvarsInExtensionsWithMethodsProtocols.h:* {{instance variable is already declared}}
// expected-error@IvarsInExtensionsWithMethodsProtocols.h:* {{instance variable is already declared}}
//--- test-redecl-in-subclass.m
// Ivar in superclass extension is not added to a subclass, so the ivar with
// the same name in subclass extension is not considered a redeclaration.
// expected-no-diagnostics
//--- test-redecl-in-implementation.m
// Ivar redeclaration in `@implementation` is always an error and never mergeable.
// expected-error@IvarsInExtensions.h:* {{instance variable is already declared}}
// expected-note@IvarInImplementation.h:* {{previous definition is here}}
// expected-error@IvarInImplementation.h:* {{instance variable is already declared}}
// expected-note@IvarsInExtensions.h:* {{previous definition is here}}