blob: a47ebf10caa93ac9c583dbc21dba9e79de5e692e [file] [log] [blame]
Chandler Carruthc2f9ea72014-12-02 00:53:20 +00001// 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
3// 'env' command.
4//
5// REQUIRES: shell
6//
7// The PATH variable is heavily used when trying to find a linker.
Hal Finkel7c0d61e2014-12-03 08:19:17 +00008// RUN: env -i LC_ALL=C LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \
9// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
Chandler Carruthc2f9ea72014-12-02 00:53:20 +000010// RUN: --target=i386-unknown-linux \
11// RUN: --sysroot=%S/Inputs/basic_linux_tree \
12// RUN: | FileCheck --check-prefix=CHECK-LD-32 %s
13//
Hal Finkel7c0d61e2014-12-03 08:19:17 +000014// 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 Carruthc2f9ea72014-12-02 00:53:20 +000016// RUN: --target=i386-unknown-linux \
17// RUN: --sysroot=%S/Inputs/basic_linux_tree \
18// RUN: | FileCheck --check-prefix=CHECK-LD-32 %s
19//
20// CHECK-LD-32-NOT: warning:
21// CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
22// CHECK-LD-32: "{{.*}}/usr/lib/gcc/i386-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o"
23// CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0"
24// CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib"
25// CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../.."
26// CHECK-LD-32: "-L[[SYSROOT]]/lib"
27// CHECK-LD-32: "-L[[SYSROOT]]/usr/lib"