2013-02-07 08:21:12 +08:00
|
|
|
// First trial: pass -DIGNORED=1 to both. This should obviously work.
|
2013-02-07 06:40:31 +08:00
|
|
|
// RUN: rm -rf %t.modules
|
2013-02-08 03:01:24 +08:00
|
|
|
// 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
|
|
|
|
// RUN: %clang_cc1 -fmodules-cache-path=%t.modules -DIGNORED=1 -fmodules -I %S/Inputs -include-pch %t.pch %s -verify
|
2013-02-07 06:40:31 +08:00
|
|
|
|
2013-02-07 08:21:12 +08:00
|
|
|
// Second trial: pass -DIGNORED=1 only to the second invocation. We
|
|
|
|
// should detect the failure.
|
|
|
|
//
|
2013-02-07 06:40:31 +08:00
|
|
|
// RUN: rm -rf %t.modules
|
2013-02-08 03:01:24 +08:00
|
|
|
// RUN: %clang_cc1 -fmodules-cache-path=%t.modules -fmodules -I %S/Inputs -emit-pch -o %t.pch -x objective-c-header %s -verify
|
|
|
|
// RUN: not %clang_cc1 -fmodules-cache-path=%t.modules -DIGNORED=1 -fmodules -I %S/Inputs -include-pch %t.pch %s > %t.err 2>&1
|
2013-02-07 06:40:31 +08:00
|
|
|
// RUN: FileCheck -check-prefix=CHECK-CONFLICT %s < %t.err
|
|
|
|
// CHECK-CONFLICT: module 'ignored_macros' found in both
|
|
|
|
|
2013-02-07 08:21:12 +08:00
|
|
|
// Third trial: pass -DIGNORED=1 only to the second invocation, but
|
|
|
|
// make it ignored. There should be no failure, IGNORED is defined in
|
|
|
|
// the translation unit but not the module.
|
|
|
|
// RUN: rm -rf %t.modules
|
2013-02-08 03:01:24 +08:00
|
|
|
// RUN: %clang_cc1 -fmodules-cache-path=%t.modules -fmodules -I %S/Inputs -emit-pch -o %t.pch -x objective-c-header %s -verify
|
|
|
|
// RUN: %clang_cc1 -fmodules-cache-path=%t.modules -DIGNORED=1 -fmodules -I %S/Inputs -include-pch %t.pch -fmodules-ignore-macro=IGNORED %s -verify
|
2013-02-07 08:21:12 +08:00
|
|
|
|
|
|
|
// Fourth trial: pass -DIGNORED=1 and -fmodules-ignore-macro=IGNORED
|
|
|
|
// to both invocations, so modules will be built without the IGNORED
|
|
|
|
// macro.
|
|
|
|
// RUN: rm -rf %t.modules
|
2013-02-08 03:01:24 +08:00
|
|
|
// 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
|
|
|
|
// 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
|
2013-02-07 08:21:12 +08:00
|
|
|
|
2013-02-07 09:18:48 +08:00
|
|
|
// Fifth trial: pass -DIGNORED=1 and -fmodules-ignore-macro=IGNORED=1
|
|
|
|
// to both invocations, so modules will be built without the IGNORED
|
|
|
|
// macro.
|
|
|
|
// RUN: rm -rf %t.modules
|
2013-02-08 03:01:24 +08:00
|
|
|
// 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
|
|
|
|
// 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
|
2013-02-07 09:18:48 +08:00
|
|
|
|
2013-02-07 06:40:31 +08:00
|
|
|
// expected-no-diagnostics
|
|
|
|
|
|
|
|
#ifndef HEADER
|
|
|
|
#define HEADER
|
|
|
|
@import ignored_macros;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
@import ignored_macros;
|
|
|
|
|
|
|
|
struct Point p;
|
2013-02-07 08:21:12 +08:00
|
|
|
|
|
|
|
#ifdef NO_IGNORED_ANYWHERE
|
|
|
|
void *has_ignored(int, int, int);
|
|
|
|
#endif
|