Chandler Carruth | feee58c | 2010-10-20 07:00:47 +0000 | [diff] [blame] | 1 | // Check for proper handling of --sysroot and -isysroot flags. |
| 2 | |
Chandler Carruth | 6b40195 | 2010-10-20 07:16:18 +0000 | [diff] [blame] | 3 | // RUN: %clang -### -fsyntax-only -isysroot /foo/bar %s 2>&1 | \ |
Chandler Carruth | feee58c | 2010-10-20 07:00:47 +0000 | [diff] [blame] | 4 | // RUN: FileCheck %s -check-prefix=ISYSROOT |
| 5 | // ISYSROOT: "-isysroot" "/foo/bar" |
| 6 | |
| 7 | // Check that we get both isysroot for headers, and pass --sysroot on to GCC to |
| 8 | // produce the final binary. |
Chandler Carruth | d9d2a87 | 2010-10-20 08:24:03 +0000 | [diff] [blame^] | 9 | // RUN: %clang -### -ccc-host-triple x86_64-unknown-linux-gnu \ |
| 10 | // RUN: --sysroot=/foo/bar -o /dev/null %s 2>&1 | \ |
| 11 | // RUN: FileCheck %s -check-prefix=SYSROOT_EQ |
Chandler Carruth | feee58c | 2010-10-20 07:00:47 +0000 | [diff] [blame] | 12 | // SYSROOT_EQ: "-isysroot" "/foo/bar" |
| 13 | // SYSROOT_EQ: "--sysroot=/foo/bar" |
| 14 | |
| 15 | // Check for overriding the header sysroot by providing both --sysroot and |
| 16 | // -isysroot. |
Chandler Carruth | d9d2a87 | 2010-10-20 08:24:03 +0000 | [diff] [blame^] | 17 | // RUN: %clang -### -ccc-host-triple x86_64-unknown-linux-gnu -isysroot /baz \ |
Chandler Carruth | 6b40195 | 2010-10-20 07:16:18 +0000 | [diff] [blame] | 18 | // RUN: --sysroot=/foo/bar -o /dev/null %s 2>&1 | FileCheck %s \ |
Chandler Carruth | feee58c | 2010-10-20 07:00:47 +0000 | [diff] [blame] | 19 | // RUN: -check-prefix=ISYSROOT_AND_SYSROOT |
| 20 | // ISYSROOT_AND_SYSROOT: "-isysroot" "/baz" |
| 21 | // ISYSROOT_AND_SYSROOT: "--sysroot=/foo/bar" |
| 22 | |
| 23 | // Check that omitting the equals works as well. |
Chandler Carruth | d9d2a87 | 2010-10-20 08:24:03 +0000 | [diff] [blame^] | 24 | // RUN: %clang -### -ccc-host-triple x86_64-unknown-linux-gnu \ |
| 25 | // RUN: --sysroot /foo/bar -o /dev/null %s 2>&1 | \ |
| 26 | // RUN: FileCheck %s -check-prefix=SYSROOT_SEPARATE |
Chandler Carruth | feee58c | 2010-10-20 07:00:47 +0000 | [diff] [blame] | 27 | // SYSROOT_SEPARATE: "-isysroot" "/foo/bar" |
| 28 | // SYSROOT_SEPARATE: "--sysroot=/foo/bar" |