blob: e122dac9b97d5497400224575bafabe2be97b419 [file] [log] [blame]
Rafael Espindola0e659592012-02-19 01:38:32 +00001// 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 \
5// RUN: -gcc-toolchain %S/Inputs/ubuntu_11.04_multiarch_tree/usr \
6// RUN: | FileCheck %s
Chandler Carruth6ce23412012-02-21 21:51:40 +00007//
8// Test for header search toolchain detection.
Rafael Espindola0e659592012-02-19 01:38:32 +00009// CHECK: "-internal-isystem"
Chandler Carruth607098c2012-02-19 23:09:50 +000010// CHECK: "[[TOOLCHAIN:[^"]+]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../../include/c++/4.5"
Rafael Espindola0e659592012-02-19 01:38:32 +000011// CHECK: "-internal-isystem"
12// CHECK: "[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../../include/c++/4.5/i686-linux-gnu"
13// CHECK: "-internal-isystem"
14// CHECK: "[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../../include/c++/4.5/backward"
Chandler Carruth6ce23412012-02-21 21:51:40 +000015// CHECK: "-internal-isystem" "/usr/local/include"
16//
Chandler Carruthe3bab982012-02-21 22:21:50 +000017// Test for linker toolchain detection. Note that only the '-L' flags will use
18// the same precise formatting of the path as the '-internal-system' flags
19// above, so we just blanket wildcard match the 'crtbegin.o'.
Chandler Carruth607098c2012-02-19 23:09:50 +000020// CHECK: "{{[^"]*}}ld{{(.exe)?}}"
Chandler Carruthe3bab982012-02-21 22:21:50 +000021// CHECK: "{{[^"]*}}/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/crtbegin.o"
22// CHECK: "-L[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5"
23// CHECK: "-L[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../.."