1 // Test that gcc-toolchain option is working correctly
2 //
3 // RUN: %clangxx -no-canonical-prefixes %s -### -o %t 2>&1 \
4 // RUN:     --target=i386-unknown-linux -stdlib=libstdc++ \
5 // RUN:     --gcc-toolchain=%S/Inputs/ubuntu_11.04_multiarch_tree/usr \
6 // RUN:     --sysroot="" \
7 // RUN:   | FileCheck %s
8 //
9 // Additionally check that the legacy spelling of the flag works.
10 // RUN: %clangxx -no-canonical-prefixes %s -### -o %t 2>&1 \
11 // RUN:     --target=i386-unknown-linux -stdlib=libstdc++ \
12 // RUN:     -gcc-toolchain %S/Inputs/ubuntu_11.04_multiarch_tree/usr \
13 // RUN:     --sysroot="" \
14 // RUN:   | FileCheck %s
15 //
16 // Test for header search toolchain detection.
17 // CHECK: "-internal-isystem"
18 // CHECK: "[[TOOLCHAIN:[^"]+]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../../include/c++/4.5"
19 // CHECK: "-internal-isystem"
20 // CHECK: "[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../../include/c++/4.5/i686-linux-gnu"
21 // CHECK: "-internal-isystem"
22 // CHECK: "[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../../include/c++/4.5/backward"
23 // CHECK: "-internal-isystem" "/usr/local/include"
24 //
25 // Test for linker toolchain detection. Note that only the '-L' flags will use
26 // the same precise formatting of the path as the '-internal-system' flags
27 // above, so we just blanket wildcard match the 'crtbegin.o'.
28 // CHECK: "{{[^"]*}}ld{{(.exe)?}}"
29 // CHECK: "{{[^"]*}}/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
30 // CHECK: "-L[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5"
31 // CHECK: "-L[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../.."
32