blob: 8896afc5e8cf1d3303fc740ee9af1dd3334f7f22 [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 \
5// RUN: -ccc-host-triple i386-unkown-linux \
6// 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:[^"]+]]"
9// CHECK-LD-32: {{.*}} "-L[[SYSROOT]]/lib" "-L[[SYSROOT]]/usr/lib"
Chandler Carruthc4cc4032011-10-01 00:37:39 +000010//
Chandler Carruthfde8d142011-10-03 06:41:08 +000011// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
12// RUN: -ccc-host-triple x86_64-unknown-linux \
13// RUN: --sysroot=%S/Inputs/basic_linux_tree \
Chandler Carruthc4cc4032011-10-01 00:37:39 +000014// RUN: | FileCheck --check-prefix=CHECK-LD-64 %s
Chandler Carruthfde8d142011-10-03 06:41:08 +000015// CHECK-LD-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
16// CHECK-LD-64: {{.*}} "-L[[SYSROOT]]/lib" "-L[[SYSROOT]]/usr/lib"