1 // RUN: rm -rf %t 2 3 // A from path 1 4 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fmodules-ignore-macro=EXPECTED_PATH -fmodules-ignore-macro=DIRECT -fsyntax-only %s -verify -I %S/Inputs/modules-with-same-name/path1/A -DDIRECT -DEXPECTED_PATH=1 5 6 // A from path 2 7 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fmodules-ignore-macro=EXPECTED_PATH -fmodules-ignore-macro=DIRECT -fsyntax-only %s -verify -I %S/Inputs/modules-with-same-name/path2/A -DDIRECT -DEXPECTED_PATH=2 8 9 // Confirm that we have two pcm files (one for each 'A'). 10 // RUN: find %t -name "A-*.pc[m]" | count 2 11 12 // DependsOnA, using A from path 1 13 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fmodules-ignore-macro=EXPECTED_PATH -fmodules-ignore-macro=DIRECT -fsyntax-only %s -verify -I %S/Inputs/modules-with-same-name/DependsOnA -I %S/Inputs/modules-with-same-name/path1/A -DEXPECTED_PATH=1 14 15 // Confirm that we have three pcm files (one for each 'A', and one for 'DependsOnA') 16 // RUN: find %t -name "*.pc[m]" | count 3 17 18 // DependsOnA, using A from path 2 19 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fmodules-ignore-macro=EXPECTED_PATH -fmodules-ignore-macro=DIRECT -fsyntax-only %s -verify -I %S/Inputs/modules-with-same-name/DependsOnA -I %S/Inputs/modules-with-same-name/path2/A -DEXPECTED_PATH=2 20 21 // Confirm that we still have three pcm files, since DependsOnA will be rebuilt 22 // RUN: find %t -name "*.pc[m]" | count 3 23 24 #ifdef DIRECT 25 @import A; 26 #else 27 @import DependsOnA; 28 #endif 29 30 #if FROM_PATH != EXPECTED_PATH 31 #error "Got the wrong module!" 32 #endif 33 34 // expected-no-diagnostics 35