47 lines · c
1// This test checks that a module map with a textual header can be marked as2// non-affecting.3 4// RUN: rm -rf %t && mkdir %t5// RUN: split-file %s %t6 7//--- X.modulemap8module X { textual header "X.h" }9//--- X.h10typedef int X_int;11 12//--- Y.modulemap13module Y { textual header "Y.h" }14//--- Y.h15typedef int Y_int;16 17//--- A.modulemap18module A { header "A.h" export * }19//--- A.h20#include "X.h"21 22// RUN: %clang_cc1 -fmodules -emit-module %t/A.modulemap -fmodule-name=A -o %t/A0.pcm \23// RUN: -fmodule-map-file=%t/X.modulemap24// RUN: %clang_cc1 -module-file-info %t/A0.pcm | FileCheck %s --check-prefix=A0 --implicit-check-not=Y.modulemap25// A0: Input file: {{.*}}X.modulemap26 27// RUN: %clang_cc1 -fmodules -emit-module %t/A.modulemap -fmodule-name=A -o %t/A1.pcm \28// RUN: -fmodule-map-file=%t/X.modulemap -fmodule-map-file=%t/Y.modulemap29// RUN: %clang_cc1 -module-file-info %t/A0.pcm | FileCheck %s --check-prefix=A1 \30// RUN: --implicit-check-not=Y.modulemap31// A1: Input file: {{.*}}X.modulemap32 33// RUN: diff %t/A0.pcm %t/A1.pcm34 35//--- B.modulemap36module B { header "B.h" export * }37//--- B.h38#include "A.h"39typedef X_int B_int;40 41// RUN: %clang_cc1 -fmodules -emit-module %t/B.modulemap -fmodule-name=B -o %t/B.pcm \42// RUN: -fmodule-file=A=%t/A0.pcm \43// RUN: -fmodule-map-file=%t/A.modulemap -fmodule-map-file=%t/X.modulemap -fmodule-map-file=%t/Y.modulemap44// RUN: %clang_cc1 -module-file-info %t/B.pcm | FileCheck %s --check-prefix=B \45// RUN: --implicit-check-not=X.modulemap --implicit-check-not=Y.modulemap46// B: Input file: {{.*}}B.modulemap47