1*0a6a1f1dSLionel Sambuc// RUN: not %clang_cc1 -fmodule-implementation-of Foo -fmodule-name=Bar %s 2>&1 \ 2*0a6a1f1dSLionel Sambuc// RUN: | FileCheck -check-prefix=CHECK-IMPL-OF-ERR %s 3*0a6a1f1dSLionel Sambuc// CHECK-IMPL-OF-ERR: conflicting module names specified: '-fmodule-name=Bar' and '-fmodule-implementation-of Foo' 4*0a6a1f1dSLionel Sambuc 5*0a6a1f1dSLionel Sambuc// RUN: rm -rf %t 6*0a6a1f1dSLionel Sambuc// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -w -Werror=auto-import %s -I %S/Inputs \ 7*0a6a1f1dSLionel Sambuc// RUN: -fmodule-implementation-of category_right -fsyntax-only 8*0a6a1f1dSLionel Sambuc 9*0a6a1f1dSLionel Sambuc// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -w -Werror=auto-import %s -I %S/Inputs \ 10*0a6a1f1dSLionel Sambuc// RUN: -fmodule-implementation-of category_right -dM -E -o - 2>&1 | FileCheck %s 11*0a6a1f1dSLionel Sambuc// CHECK-NOT: __building_module 12*0a6a1f1dSLionel Sambuc 13*0a6a1f1dSLionel Sambuc// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -w -Werror=auto-import %s -I %S/Inputs \ 14*0a6a1f1dSLionel Sambuc// RUN: -fmodule-implementation-of category_left -verify 15*0a6a1f1dSLionel Sambuc 16*0a6a1f1dSLionel Sambuc// RUN: %clang_cc1 -x objective-c-header -fmodules -fmodules-cache-path=%t -w -Werror=auto-import %s -I %S/Inputs \ 17*0a6a1f1dSLionel Sambuc// RUN: -fmodule-implementation-of category_right -emit-pch -o %t.pch 18*0a6a1f1dSLionel Sambuc// RUN: %clang_cc1 -x objective-c-header -fmodules -fmodules-cache-path=%t -w -Werror=auto-import %s -I %S/Inputs \ 19*0a6a1f1dSLionel Sambuc// RUN: -DWITH_PREFIX -include-pch %t.pch -fmodule-implementation-of category_right 20*0a6a1f1dSLionel Sambuc 21*0a6a1f1dSLionel Sambuc#ifndef WITH_PREFIX 22*0a6a1f1dSLionel Sambuc 23*0a6a1f1dSLionel Sambuc@import category_left; // expected-error{{@import of module 'category_left' in implementation of 'category_left'; use #import}} 24*0a6a1f1dSLionel Sambuc@import category_left.sub; // expected-error{{@import of module 'category_left.sub' in implementation of 'category_left'; use #import}} 25*0a6a1f1dSLionel Sambuc#import "category_right.h" // expected-error{{treating}} 26*0a6a1f1dSLionel Sambuc#import "category_right_sub.h" // expected-error{{treating}} 27*0a6a1f1dSLionel Sambuc 28*0a6a1f1dSLionel Sambuc#endif 29*0a6a1f1dSLionel Sambuc 30