63 lines · plain
1// Check that the presence of non-affecting module map files does not affect the2// contents of PCM files.3 4// RUN: rm -rf %t && mkdir %t5// RUN: split-file %s %t6 7//--- a/module.modulemap8module a {}9 10//--- b/module.modulemap11module b {}12 13//--- c/module.modulemap14module c { header "c.h" }15//--- c/c.h16@import b;17 18//--- tu.m19@import c;20 21//--- explicit-mms-common-args.rsp22-fmodule-map-file=b/module.modulemap -fmodule-map-file=c/module.modulemap -fmodules -fmodules-cache-path=cache -fdisable-module-hash -fsyntax-only tu.m23//--- implicit-search-args.rsp24-I a -I b -I c -fimplicit-module-maps -fmodules -fmodules-cache-path=cache -fdisable-module-hash -fsyntax-only tu.m25//--- implicit-search-args.rsp-end26 27// Test with explicit module map files.28//29// RUN: %clang_cc1 -working-directory %t @%t/explicit-mms-common-args.rsp30// RUN: mv %t/cache %t/cache-explicit-no-a-prune31// RUN: %clang_cc1 -working-directory %t @%t/explicit-mms-common-args.rsp -fno-modules-prune-non-affecting-module-map-files32// RUN: mv %t/cache %t/cache-explicit-no-a-keep33//34// RUN: %clang_cc1 -working-directory %t -fmodule-map-file=a/module.modulemap @%t/explicit-mms-common-args.rsp35// RUN: mv %t/cache %t/cache-explicit-a-prune36// RUN: %clang_cc1 -working-directory %t -fmodule-map-file=a/module.modulemap @%t/explicit-mms-common-args.rsp -fno-modules-prune-non-affecting-module-map-files37// RUN: mv %t/cache %t/cache-explicit-a-keep38//39// RUN: diff %t/cache-explicit-no-a-prune/c.pcm %t/cache-explicit-a-prune/c.pcm40// RUN: not diff %t/cache-explicit-no-a-keep/c.pcm %t/cache-explicit-a-keep/c.pcm41 42// Test with implicit module map search.43//44// RUN: %clang_cc1 -working-directory %t @%t/implicit-search-args.rsp45// RUN: mv %t/cache %t/cache-implicit-no-a-prune46// RUN: %clang_cc1 -working-directory %t @%t/implicit-search-args.rsp -fno-modules-prune-non-affecting-module-map-files47// RUN: mv %t/cache %t/cache-implicit-no-a-keep48//49// FIXME: Instead of removing "a/module.modulemap" from the file system, we50// could drop the "-I a" search path argument in combination with the51// "-fmodules-skip-header-search-paths" flag. Unfortunately, that flag52// does not prevent serialization of the search path usage bit vector,53// making the files differ anyways.54// RUN: rm %t/a/module.modulemap55//56// RUN: %clang_cc1 -working-directory %t @%t/implicit-search-args.rsp57// RUN: mv %t/cache %t/cache-implicit-a-prune58// RUN: %clang_cc1 -working-directory %t @%t/implicit-search-args.rsp -fno-modules-prune-non-affecting-module-map-files59// RUN: mv %t/cache %t/cache-implicit-a-keep60//61// RUN: diff %t/cache-implicit-no-a-prune/c.pcm %t/cache-implicit-a-prune/c.pcm62// RUN: not diff %t/cache-implicit-no-a-keep/c.pcm %t/cache-implicit-a-keep/c.pcm63