mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-05-14 01:46:41 +00:00

Getting the default module cache path calls llvm::sys::path::cache_directory, which calls home_directory, which checks the HOME environment variable before falling back to getpwuid. When compiling against musl libc, which does not support NSS, and running on a machine that doesn't have the current user in /etc/passwd due to NSS, no home directory can be found. Set the HOME environment variable in the tests to avoid depending on getpwuid. Reviewed By: pirama, srhines Differential Revision: https://reviews.llvm.org/D132984
7 lines
414 B
C
7 lines
414 B
C
// RUN: env HOME=%t.home %clang -fmodules -fimplicit-module-maps %s -### 2>&1 | FileCheck -check-prefix CHECK-NO_MODULE_CACHE %s
|
|
// RUN: %clang -fmodules -fimplicit-module-maps -fmodules-cache-path=blarg %s -### 2>&1 | FileCheck -check-prefix CHECK-WITH_MODULE_CACHE %s
|
|
|
|
// CHECK-NO_MODULE_CACHE: {{clang.*"-fmodules-cache-path=.*ModuleCache"}}
|
|
|
|
// CHECK-WITH_MODULE_CACHE: {{clang.*"-fmodules-cache-path=blarg"}}
|