Fix driver tests when LLVM_ENABLE_PER_TARGET_RUNTIME_DIR is ON

Some Driver tests relied on the default resource direcory having per-os per-arch
subdirectory layout, and when clang is built with `-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON`,
those test fail, because clang by default assumes per-target subdirectories.

Explicitly set `-resource-dir` flag to point to a tree with per-os per-arch layout.

See also: D45604, D62469

Differential Revision: https://reviews.llvm.org/D66981

Patch by Sergej Jaskiewicz <jaskiewiczs@icloud.com>.

llvm-svn: 373565
This commit is contained in:
Serge Pavlov 2019-10-03 04:52:46 +00:00
parent f913fd6eb0
commit 110a24fb44
2 changed files with 35 additions and 7 deletions

View File

@ -1,21 +1,42 @@
// RUN: %clang -target arm-linux-gnueabi -rtlib=compiler-rt -### %s 2>&1 | FileCheck %s -check-prefix ARM-GNUEABI
// RUN: %clang -target arm-linux-gnueabi \
// RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
// RUN: -rtlib=compiler-rt -### %s 2>&1 \
// RUN: | FileCheck %s -check-prefix ARM-GNUEABI
// ARM-GNUEABI: "{{.*[/\\]}}libclang_rt.builtins-arm.a"
// RUN: %clang -target arm-linux-gnueabi -rtlib=compiler-rt -mfloat-abi=hard -### %s 2>&1 | FileCheck %s -check-prefix ARM-GNUEABI-ABI
// RUN: %clang -target arm-linux-gnueabi \
// RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
// RUN: -rtlib=compiler-rt -mfloat-abi=hard -### %s 2>&1 \
// RUN: | FileCheck %s -check-prefix ARM-GNUEABI-ABI
// ARM-GNUEABI-ABI: "{{.*[/\\]}}libclang_rt.builtins-armhf.a"
// RUN: %clang -target arm-linux-gnueabihf -rtlib=compiler-rt -### %s 2>&1 | FileCheck %s -check-prefix ARM-GNUEABIHF
// RUN: %clang -target arm-linux-gnueabihf \
// RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
// RUN: -rtlib=compiler-rt -### %s 2>&1 \
// RUN: | FileCheck %s -check-prefix ARM-GNUEABIHF
// ARM-GNUEABIHF: "{{.*[/\\]}}libclang_rt.builtins-armhf.a"
// RUN: %clang -target arm-linux-gnueabihf -rtlib=compiler-rt -mfloat-abi=soft -### %s 2>&1 | FileCheck %s -check-prefix ARM-GNUEABIHF-ABI
// RUN: %clang -target arm-linux-gnueabihf \
// RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
// RUN: -rtlib=compiler-rt -mfloat-abi=soft -### %s 2>&1 \
// RUN: | FileCheck %s -check-prefix ARM-GNUEABIHF-ABI
// ARM-GNUEABIHF-ABI: "{{.*[/\\]}}libclang_rt.builtins-arm.a"
// RUN: %clang -target arm-windows-itanium -rtlib=compiler-rt -### %s 2>&1 | FileCheck %s -check-prefix ARM-WINDOWS
// RUN: %clang -target arm-windows-itanium \
// RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
// RUN: -rtlib=compiler-rt -### %s 2>&1 \
// RUN: | FileCheck %s -check-prefix ARM-WINDOWS
// ARM-WINDOWS: "{{.*[/\\]}}clang_rt.builtins-arm.lib"
// RUN: %clang -target arm-linux-androideabi -rtlib=compiler-rt -### %s 2>&1 | FileCheck %s -check-prefix ARM-ANDROID
// RUN: %clang -target arm-linux-androideabi \
// RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
// RUN: -rtlib=compiler-rt -### %s 2>&1 \
// RUN: | FileCheck %s -check-prefix ARM-ANDROID
// ARM-ANDROID: "{{.*[/\\]}}libclang_rt.builtins-arm-android.a"
// RUN: %clang -target arm-linux-androideabi -rtlib=compiler-rt -mfloat-abi=hard -### %s 2>&1 | FileCheck %s -check-prefix ARM-ANDROIDHF
// RUN: %clang -target arm-linux-androideabi \
// RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
// RUN: -rtlib=compiler-rt -mfloat-abi=hard -### %s 2>&1 \
// RUN: | FileCheck %s -check-prefix ARM-ANDROIDHF
// ARM-ANDROIDHF: "{{.*[/\\]}}libclang_rt.builtins-armhf-android.a"

View File

@ -2,11 +2,13 @@
// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name 2>&1 \
// RUN: --target=x86_64-pc-linux \
// RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-X8664 %s
// CHECK-CLANGRT-X8664: libclang_rt.builtins-x86_64.a
// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name 2>&1 \
// RUN: --target=i386-pc-linux \
// RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-I386 %s
// CHECK-CLANGRT-I386: libclang_rt.builtins-i386.a
@ -14,24 +16,29 @@
//
// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name 2>&1 \
// RUN: --target=i686-pc-linux \
// RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-I386 %s
// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name 2>&1 \
// RUN: --target=arm-linux-gnueabi \
// RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-ARM %s
// CHECK-CLANGRT-ARM: libclang_rt.builtins-arm.a
// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name 2>&1 \
// RUN: --target=arm-linux-androideabi \
// RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-ARM-ANDROID %s
// CHECK-CLANGRT-ARM-ANDROID: libclang_rt.builtins-arm-android.a
// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name 2>&1 \
// RUN: --target=arm-linux-gnueabihf \
// RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-ARMHF %s
// CHECK-CLANGRT-ARMHF: libclang_rt.builtins-armhf.a
// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name 2>&1 \
// RUN: --target=arm-linux-gnueabi -mfloat-abi=hard \
// RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-ARM-ABI %s
// CHECK-CLANGRT-ARM-ABI: libclang_rt.builtins-armhf.a