
Use `VFS.equivalent()`, which follows symlinks, to check if two module cache paths are equivalent. This prevents a PCH error when building from a different path that is a symlink of the original. ``` error: PCH was compiled with module cache path '/home/foo/blah/ModuleCache/2IBP1TNT8OR8D', but the path is currently '/data/users/foo/blah/ModuleCache/2IBP1TNT8OR8D' 1 error generated. ```
15 lines
553 B
Objective-C
15 lines
553 B
Objective-C
// REQUIRES: shell
|
|
|
|
// RUN: rm -rf %t
|
|
// RUN: %clang_cc1 -fmodules-cache-path=%t/modules -fmodules -fimplicit-module-maps -I %S/Inputs -emit-pch -o %t.pch %s -verify
|
|
|
|
// RUN: ln -s %t/modules %t/modules.symlink
|
|
// RUN: %clang_cc1 -fmodules-cache-path=%t/modules.symlink -fmodules -fimplicit-module-maps -I %S/Inputs -include-pch %t.pch %s -verify
|
|
// RUN: not %clang_cc1 -fmodules-cache-path=%t/modules.dne -fmodules -fimplicit-module-maps -I %S/Inputs -include-pch %t.pch %s -verify
|
|
|
|
// expected-no-diagnostics
|
|
|
|
@import ignored_macros;
|
|
|
|
struct Point p;
|