1*f4a2713aSLionel Sambuc// First trial: pass -DIGNORED=1 to both. This should obviously work. 2*f4a2713aSLionel Sambuc// RUN: rm -rf %t.modules 3*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fmodules-cache-path=%t.modules -DIGNORED=1 -fmodules -I %S/Inputs -emit-pch -o %t.pch -x objective-c-header %s -verify 4*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fmodules-cache-path=%t.modules -DIGNORED=1 -fmodules -I %S/Inputs -include-pch %t.pch %s -verify 5*f4a2713aSLionel Sambuc 6*f4a2713aSLionel Sambuc// Second trial: pass -DIGNORED=1 only to the second invocation. We 7*f4a2713aSLionel Sambuc// should detect the failure. 8*f4a2713aSLionel Sambuc// 9*f4a2713aSLionel Sambuc// RUN: rm -rf %t.modules 10*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fmodules-cache-path=%t.modules -fmodules -I %S/Inputs -emit-pch -o %t.pch -x objective-c-header %s -verify 11*f4a2713aSLionel Sambuc// RUN: not %clang_cc1 -fmodules-cache-path=%t.modules -DIGNORED=1 -fmodules -I %S/Inputs -include-pch %t.pch %s > %t.err 2>&1 12*f4a2713aSLionel Sambuc// RUN: FileCheck -check-prefix=CHECK-CONFLICT %s < %t.err 13*f4a2713aSLionel Sambuc// CHECK-CONFLICT: module 'ignored_macros' found in both 14*f4a2713aSLionel Sambuc 15*f4a2713aSLionel Sambuc// Third trial: pass -DIGNORED=1 only to the second invocation, but 16*f4a2713aSLionel Sambuc// make it ignored. There should be no failure, IGNORED is defined in 17*f4a2713aSLionel Sambuc// the translation unit but not the module. 18*f4a2713aSLionel Sambuc// RUN: rm -rf %t.modules 19*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fmodules-cache-path=%t.modules -fmodules -I %S/Inputs -emit-pch -o %t.pch -x objective-c-header %s -verify 20*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fmodules-cache-path=%t.modules -DIGNORED=1 -fmodules -I %S/Inputs -include-pch %t.pch -fmodules-ignore-macro=IGNORED %s -verify 21*f4a2713aSLionel Sambuc 22*f4a2713aSLionel Sambuc// Fourth trial: pass -DIGNORED=1 and -fmodules-ignore-macro=IGNORED 23*f4a2713aSLionel Sambuc// to both invocations, so modules will be built without the IGNORED 24*f4a2713aSLionel Sambuc// macro. 25*f4a2713aSLionel Sambuc// RUN: rm -rf %t.modules 26*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fmodules-cache-path=%t.modules -DIGNORED=1 -fmodules-ignore-macro=IGNORED -fmodules -I %S/Inputs -emit-pch -o %t.pch -x objective-c-header %s -verify 27*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fmodules-cache-path=%t.modules -DIGNORED=1 -fmodules -I %S/Inputs -include-pch %t.pch -fmodules-ignore-macro=IGNORED -DNO_IGNORED_ANYWHERE -fmodules-ignore-macro=NO_IGNORED_ANYWHERE %s -verify 28*f4a2713aSLionel Sambuc 29*f4a2713aSLionel Sambuc// Fifth trial: pass -DIGNORED=1 and -fmodules-ignore-macro=IGNORED=1 30*f4a2713aSLionel Sambuc// to both invocations, so modules will be built without the IGNORED 31*f4a2713aSLionel Sambuc// macro. 32*f4a2713aSLionel Sambuc// RUN: rm -rf %t.modules 33*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fmodules-cache-path=%t.modules -DIGNORED=1 -fmodules-ignore-macro=IGNORED=1 -fmodules -I %S/Inputs -emit-pch -o %t.pch -x objective-c-header %s -verify 34*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fmodules-cache-path=%t.modules -DIGNORED=1 -fmodules -I %S/Inputs -include-pch %t.pch -fmodules-ignore-macro=IGNORED=1 -DNO_IGNORED_ANYWHERE -fmodules-ignore-macro=NO_IGNORED_ANYWHERE %s -verify 35*f4a2713aSLionel Sambuc 36*f4a2713aSLionel Sambuc// expected-no-diagnostics 37*f4a2713aSLionel Sambuc 38*f4a2713aSLionel Sambuc#ifndef HEADER 39*f4a2713aSLionel Sambuc#define HEADER 40*f4a2713aSLionel Sambuc@import ignored_macros; 41*f4a2713aSLionel Sambuc#endif 42*f4a2713aSLionel Sambuc 43*f4a2713aSLionel Sambuc@import ignored_macros; 44*f4a2713aSLionel Sambuc 45*f4a2713aSLionel Sambucstruct Point p; 46*f4a2713aSLionel Sambuc 47*f4a2713aSLionel Sambuc#ifdef NO_IGNORED_ANYWHERE 48*f4a2713aSLionel Sambucvoid *has_ignored(int, int, int); 49*f4a2713aSLionel Sambuc#endif 50