blob: aa0e078160ef8c33bdcded3d971bf89689f448db [file] [log] [blame]
Rafael Espindola1af7c212012-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 \
Chandler Carruth274b6f02013-06-20 09:42:40 +00004// RUN: --target=i386-unknown-linux \
5// RUN: --gcc-toolchain=%S/Inputs/ubuntu_11.04_multiarch_tree/usr \
6// RUN: | FileCheck %s
7//
8// Additionally check that the legacy spelling of the flag works.
9// RUN: %clangxx -no-canonical-prefixes %s -### -o %t 2>&1 \
10// RUN: --target=i386-unknown-linux \
Rafael Espindola1af7c212012-02-19 01:38:32 +000011// RUN: -gcc-toolchain %S/Inputs/ubuntu_11.04_multiarch_tree/usr \
12// RUN: | FileCheck %s
Chandler Carruth286e0e02012-02-21 21:51:40 +000013//
14// Test for header search toolchain detection.
Rafael Espindola1af7c212012-02-19 01:38:32 +000015// CHECK: "-internal-isystem"
Chandler Carruth4fc5fcd2012-02-19 23:09:50 +000016// CHECK: "[[TOOLCHAIN:[^"]+]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../../include/c++/4.5"
Rafael Espindola1af7c212012-02-19 01:38:32 +000017// CHECK: "-internal-isystem"
18// CHECK: "[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../../include/c++/4.5/i686-linux-gnu"
19// CHECK: "-internal-isystem"
20// CHECK: "[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../../include/c++/4.5/backward"
Chandler Carruth286e0e02012-02-21 21:51:40 +000021// CHECK: "-internal-isystem" "/usr/local/include"
22//
Chandler Carruth85061b52012-02-21 22:21:50 +000023// Test for linker toolchain detection. Note that only the '-L' flags will use
24// the same precise formatting of the path as the '-internal-system' flags
25// above, so we just blanket wildcard match the 'crtbegin.o'.
Chandler Carruth4fc5fcd2012-02-19 23:09:50 +000026// CHECK: "{{[^"]*}}ld{{(.exe)?}}"
Rafael Espindola49ddb862013-06-24 22:07:15 +000027// CHECK: "{{[^"]*}}/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
Chandler Carruth85061b52012-02-21 22:21:50 +000028// CHECK: "-L[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5"
29// CHECK: "-L[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../.."