r373565 - Fix driver tests when `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR` is `ON`

Serge Pavlov via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 2 21:52:46 PDT 2019


Author: sepavloff
Date: Wed Oct  2 21:52:46 2019
New Revision: 373565

URL: http://llvm.org/viewvc/llvm-project?rev=373565&view=rev
Log:
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 at icloud.com>.

Modified:
    cfe/trunk/test/Driver/arm-compiler-rt.c
    cfe/trunk/test/Driver/print-libgcc-file-name-clangrt.c

Modified: cfe/trunk/test/Driver/arm-compiler-rt.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/arm-compiler-rt.c?rev=373565&r1=373564&r2=373565&view=diff
==============================================================================
--- cfe/trunk/test/Driver/arm-compiler-rt.c (original)
+++ cfe/trunk/test/Driver/arm-compiler-rt.c Wed Oct  2 21:52:46 2019
@@ -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"
 

Modified: cfe/trunk/test/Driver/print-libgcc-file-name-clangrt.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/print-libgcc-file-name-clangrt.c?rev=373565&r1=373564&r2=373565&view=diff
==============================================================================
--- cfe/trunk/test/Driver/print-libgcc-file-name-clangrt.c (original)
+++ cfe/trunk/test/Driver/print-libgcc-file-name-clangrt.c Wed Oct  2 21:52:46 2019
@@ -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




More information about the cfe-commits mailing list