Chandler Carruth | fde8d14 | 2011-10-03 06:41:08 +0000 | [diff] [blame] | 1 | // General tests that ld invocations on Linux targets sane. Note that we use |
| 2 | // sysroot to make these tests independent of the host system. |
Chandler Carruth | c4cc403 | 2011-10-01 00:37:39 +0000 | [diff] [blame] | 3 | // |
Chandler Carruth | fde8d14 | 2011-10-03 06:41:08 +0000 | [diff] [blame] | 4 | // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ |
Chandler Carruth | 663abc9 | 2011-10-03 08:02:58 +0000 | [diff] [blame] | 5 | // RUN: -ccc-host-triple i386-unknown-linux \ |
Chandler Carruth | fde8d14 | 2011-10-03 06:41:08 +0000 | [diff] [blame] | 6 | // RUN: --sysroot=%S/Inputs/basic_linux_tree \ |
Chandler Carruth | c4cc403 | 2011-10-01 00:37:39 +0000 | [diff] [blame] | 7 | // RUN: | FileCheck --check-prefix=CHECK-LD-32 %s |
Chandler Carruth | fde8d14 | 2011-10-03 06:41:08 +0000 | [diff] [blame] | 8 | // CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" |
Chandler Carruth | 663abc9 | 2011-10-03 08:02:58 +0000 | [diff] [blame] | 9 | // CHECK-LD-32: "[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/crtbegin.o" |
| 10 | // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0" |
Chandler Carruth | 621e6a6 | 2011-10-03 08:09:02 +0000 | [diff] [blame^] | 11 | // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib" |
Chandler Carruth | 663abc9 | 2011-10-03 08:02:58 +0000 | [diff] [blame] | 12 | // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../.." |
| 13 | // CHECK-LD-32: "-L[[SYSROOT]]/lib" |
| 14 | // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib" |
Chandler Carruth | c4cc403 | 2011-10-01 00:37:39 +0000 | [diff] [blame] | 15 | // |
Chandler Carruth | fde8d14 | 2011-10-03 06:41:08 +0000 | [diff] [blame] | 16 | // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ |
| 17 | // RUN: -ccc-host-triple x86_64-unknown-linux \ |
| 18 | // RUN: --sysroot=%S/Inputs/basic_linux_tree \ |
Chandler Carruth | c4cc403 | 2011-10-01 00:37:39 +0000 | [diff] [blame] | 19 | // RUN: | FileCheck --check-prefix=CHECK-LD-64 %s |
Chandler Carruth | fde8d14 | 2011-10-03 06:41:08 +0000 | [diff] [blame] | 20 | // CHECK-LD-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" |
Chandler Carruth | 663abc9 | 2011-10-03 08:02:58 +0000 | [diff] [blame] | 21 | // CHECK-LD-64: "[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/crtbegin.o" |
| 22 | // CHECK-LD-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0" |
Chandler Carruth | 621e6a6 | 2011-10-03 08:09:02 +0000 | [diff] [blame^] | 23 | // CHECK-LD-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib" |
Chandler Carruth | 663abc9 | 2011-10-03 08:02:58 +0000 | [diff] [blame] | 24 | // CHECK-LD-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.." |
| 25 | // CHECK-LD-64: "-L[[SYSROOT]]/lib" |
| 26 | // CHECK-LD-64: "-L[[SYSROOT]]/usr/lib" |