brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.8 KiB · fe5a6f3 Raw
50 lines · plain
1// First trial: pass -DIGNORED=1 to both. This should obviously work.2// RUN: rm -rf %t.modules3// RUN: %clang_cc1 -fmodules-cache-path=%t.modules -DIGNORED=1 -fmodules -fimplicit-module-maps -I %S/Inputs -emit-pch -o %t.pch -x objective-c-header %s -verify4// RUN: %clang_cc1 -fmodules-cache-path=%t.modules -DIGNORED=1 -fmodules -fimplicit-module-maps -I %S/Inputs -include-pch %t.pch %s -verify5 6// Second trial: pass -DIGNORED=1 only to the second invocation. We7// should detect the failure.8//9// RUN: rm -rf %t.modules10// RUN: %clang_cc1 -fmodules-cache-path=%t.modules -fmodules -fimplicit-module-maps -I %S/Inputs -emit-pch -o %t.pch -x objective-c-header %s -verify11// RUN: not %clang_cc1 -fmodules-cache-path=%t.modules -DIGNORED=1 -fmodules -fimplicit-module-maps -I %S/Inputs -include-pch %t.pch %s > %t.err 2>&112// RUN: FileCheck -check-prefix=CHECK-CONFLICT %s < %t.err13// CHECK-CONFLICT: precompiled file '{{.*}}' was compiled with module cache path14 15// Third trial: pass -DIGNORED=1 only to the second invocation, but16// make it ignored. There should be no failure, IGNORED is defined in17// the translation unit but not the module.18// RUN: rm -rf %t.modules19// RUN: %clang_cc1 -fmodules-cache-path=%t.modules -fmodules -fimplicit-module-maps -I %S/Inputs -emit-pch -o %t.pch -x objective-c-header %s -verify20// RUN: %clang_cc1 -fmodules-cache-path=%t.modules -DIGNORED=1 -fmodules -fimplicit-module-maps -I %S/Inputs -include-pch %t.pch -fmodules-ignore-macro=IGNORED %s -verify21 22// Fourth trial: pass -DIGNORED=1 and -fmodules-ignore-macro=IGNORED23// to both invocations, so modules will be built without the IGNORED24// macro.25// RUN: rm -rf %t.modules26// RUN: %clang_cc1 -fmodules-cache-path=%t.modules -DIGNORED=1 -fmodules-ignore-macro=IGNORED -fmodules -fimplicit-module-maps -I %S/Inputs -emit-pch -o %t.pch -x objective-c-header %s -verify27// RUN: %clang_cc1 -fmodules-cache-path=%t.modules -DIGNORED=1 -fmodules -fimplicit-module-maps -I %S/Inputs -include-pch %t.pch -fmodules-ignore-macro=IGNORED -DNO_IGNORED_ANYWHERE -fmodules-ignore-macro=NO_IGNORED_ANYWHERE %s -verify28 29// Fifth trial: pass -DIGNORED=1 and -fmodules-ignore-macro=IGNORED=130// to both invocations, so modules will be built without the IGNORED31// macro.32// RUN: rm -rf %t.modules33// RUN: %clang_cc1 -fmodules-cache-path=%t.modules -DIGNORED=1 -fmodules-ignore-macro=IGNORED=1 -fmodules -fimplicit-module-maps -I %S/Inputs -emit-pch -o %t.pch -x objective-c-header %s -verify34// RUN: %clang_cc1 -fmodules-cache-path=%t.modules -DIGNORED=1 -fmodules -fimplicit-module-maps -I %S/Inputs -include-pch %t.pch -fmodules-ignore-macro=IGNORED=1 -DNO_IGNORED_ANYWHERE -fmodules-ignore-macro=NO_IGNORED_ANYWHERE %s -verify35 36// expected-no-diagnostics37 38#ifndef HEADER39#define HEADER40@import ignored_macros;41#endif42 43@import ignored_macros;44 45struct Point p;46 47#ifdef NO_IGNORED_ANYWHERE48void *has_ignored(int, int, int);49#endif50