blob: 63b10205773df93a01448b3d43d60f4e597efbf1 [file] [log] [blame]
Chandler Carruthfde8d142011-10-03 06:41:08 +00001// 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 Carruthc4cc4032011-10-01 00:37:39 +00003//
Chandler Carruthfde8d142011-10-03 06:41:08 +00004// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
Chandler Carruth663abc92011-10-03 08:02:58 +00005// RUN: -ccc-host-triple i386-unknown-linux \
Chandler Carruthfde8d142011-10-03 06:41:08 +00006// RUN: --sysroot=%S/Inputs/basic_linux_tree \
Chandler Carruthc4cc4032011-10-01 00:37:39 +00007// RUN: | FileCheck --check-prefix=CHECK-LD-32 %s
Chandler Carruthfde8d142011-10-03 06:41:08 +00008// CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
Chandler Carruth663abc92011-10-03 08:02:58 +00009// 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"
11// CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../.."
12// CHECK-LD-32: "-L[[SYSROOT]]/lib"
13// CHECK-LD-32: "-L[[SYSROOT]]/usr/lib"
Chandler Carruthc4cc4032011-10-01 00:37:39 +000014//
Chandler Carruthfde8d142011-10-03 06:41:08 +000015// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
16// RUN: -ccc-host-triple x86_64-unknown-linux \
17// RUN: --sysroot=%S/Inputs/basic_linux_tree \
Chandler Carruthc4cc4032011-10-01 00:37:39 +000018// RUN: | FileCheck --check-prefix=CHECK-LD-64 %s
Chandler Carruthfde8d142011-10-03 06:41:08 +000019// CHECK-LD-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
Chandler Carruth663abc92011-10-03 08:02:58 +000020// CHECK-LD-64: "[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/crtbegin.o"
21// CHECK-LD-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
22// CHECK-LD-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.."
23// CHECK-LD-64: "-L[[SYSROOT]]/lib"
24// CHECK-LD-64: "-L[[SYSROOT]]/usr/lib"