Rafael Espindola | 1af7c21 | 2012-02-19 01:38:32 +0000 | [diff] [blame] | 1 | // Test that gcc-toolchain option is working correctly |
| 2 | // |
| 3 | // RUN: %clangxx -no-canonical-prefixes %s -### -o %t 2>&1 \ |
Chandler Carruth | 274b6f0 | 2013-06-20 09:42:40 +0000 | [diff] [blame] | 4 | // 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 Espindola | 1af7c21 | 2012-02-19 01:38:32 +0000 | [diff] [blame] | 11 | // RUN: -gcc-toolchain %S/Inputs/ubuntu_11.04_multiarch_tree/usr \ |
| 12 | // RUN: | FileCheck %s |
Chandler Carruth | 286e0e0 | 2012-02-21 21:51:40 +0000 | [diff] [blame] | 13 | // |
| 14 | // Test for header search toolchain detection. |
Rafael Espindola | 1af7c21 | 2012-02-19 01:38:32 +0000 | [diff] [blame] | 15 | // CHECK: "-internal-isystem" |
Chandler Carruth | 4fc5fcd | 2012-02-19 23:09:50 +0000 | [diff] [blame] | 16 | // CHECK: "[[TOOLCHAIN:[^"]+]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../../include/c++/4.5" |
Rafael Espindola | 1af7c21 | 2012-02-19 01:38:32 +0000 | [diff] [blame] | 17 | // 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 Carruth | 286e0e0 | 2012-02-21 21:51:40 +0000 | [diff] [blame] | 21 | // CHECK: "-internal-isystem" "/usr/local/include" |
| 22 | // |
Chandler Carruth | 85061b5 | 2012-02-21 22:21:50 +0000 | [diff] [blame] | 23 | // 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 Carruth | 4fc5fcd | 2012-02-19 23:09:50 +0000 | [diff] [blame] | 26 | // CHECK: "{{[^"]*}}ld{{(.exe)?}}" |
Rafael Espindola | 49ddb86 | 2013-06-24 22:07:15 +0000 | [diff] [blame] | 27 | // CHECK: "{{[^"]*}}/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5{{/|\\\\}}crtbegin.o" |
Chandler Carruth | 85061b5 | 2012-02-21 22:21:50 +0000 | [diff] [blame] | 28 | // 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/../../../.." |