Chandler Carruth | c2f9ea7 | 2014-12-02 00:53:20 +0000 | [diff] [blame] | 1 | // These tests try to ensure that the driver operates reasonably when run with |
| 2 | // a strange environment. Unfortunately, it requires a normal shell and the |
Yaron Keren | 5a76498 | 2015-07-26 04:36:39 +0000 | [diff] [blame] | 3 | // 'env' command that understands arguments, unlike the LIT built-in env. |
Chandler Carruth | c2f9ea7 | 2014-12-02 00:53:20 +0000 | [diff] [blame] | 4 | // |
| 5 | // REQUIRES: shell |
Chandler Carruth | c2f9ea7 | 2014-12-02 00:53:20 +0000 | [diff] [blame] | 6 | // The PATH variable is heavily used when trying to find a linker. |
Hal Finkel | 7c0d61e | 2014-12-03 08:19:17 +0000 | [diff] [blame] | 7 | // RUN: env -i LC_ALL=C LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \ |
| 8 | // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ |
Chandler Carruth | c2f9ea7 | 2014-12-02 00:53:20 +0000 | [diff] [blame] | 9 | // RUN: --target=i386-unknown-linux \ |
| 10 | // RUN: --sysroot=%S/Inputs/basic_linux_tree \ |
Samuel Antao | 4ae1f67 | 2015-01-05 17:07:42 +0000 | [diff] [blame] | 11 | // RUN: --gcc-toolchain="" \ |
Chandler Carruth | c2f9ea7 | 2014-12-02 00:53:20 +0000 | [diff] [blame] | 12 | // RUN: | FileCheck --check-prefix=CHECK-LD-32 %s |
| 13 | // |
Hal Finkel | 7c0d61e | 2014-12-03 08:19:17 +0000 | [diff] [blame] | 14 | // RUN: env -i LC_ALL=C PATH="" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \ |
| 15 | // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ |
Chandler Carruth | c2f9ea7 | 2014-12-02 00:53:20 +0000 | [diff] [blame] | 16 | // RUN: --target=i386-unknown-linux \ |
| 17 | // RUN: --sysroot=%S/Inputs/basic_linux_tree \ |
Samuel Antao | 4ae1f67 | 2015-01-05 17:07:42 +0000 | [diff] [blame] | 18 | // RUN: --gcc-toolchain="" \ |
Chandler Carruth | c2f9ea7 | 2014-12-02 00:53:20 +0000 | [diff] [blame] | 19 | // RUN: | FileCheck --check-prefix=CHECK-LD-32 %s |
| 20 | // |
| 21 | // CHECK-LD-32-NOT: warning: |
| 22 | // CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" |
| 23 | // CHECK-LD-32: "{{.*}}/usr/lib/gcc/i386-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o" |
| 24 | // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0" |
| 25 | // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib" |
| 26 | // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../.." |
| 27 | // CHECK-LD-32: "-L[[SYSROOT]]/lib" |
| 28 | // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib" |