Chandler Carruth | 24e17e1 | 2010-10-20 07:00:47 +0000 | [diff] [blame^] | 1 | // Check for proper handling of --sysroot and -isysroot flags. |
| 2 | |
| 3 | // RUN: %clang -### -fsyntax-only -isysroot /foo/bar %s |& \ |
| 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. |
| 9 | // RUN: %clang -### -triple x86_64-unknown-linux-gnu --sysroot=/foo/bar \ |
| 10 | // RUN: -o /dev/null %s |& FileCheck %s -check-prefix=SYSROOT_EQ |
| 11 | // SYSROOT_EQ: "-isysroot" "/foo/bar" |
| 12 | // SYSROOT_EQ: "--sysroot=/foo/bar" |
| 13 | |
| 14 | // Check for overriding the header sysroot by providing both --sysroot and |
| 15 | // -isysroot. |
| 16 | // RUN: %clang -### -triple x86_64-unknown-linux-gnu -isysroot /baz \ |
| 17 | // RUN: --sysroot=/foo/bar -o /dev/null %s |& FileCheck %s \ |
| 18 | // RUN: -check-prefix=ISYSROOT_AND_SYSROOT |
| 19 | // ISYSROOT_AND_SYSROOT: "-isysroot" "/baz" |
| 20 | // ISYSROOT_AND_SYSROOT: "--sysroot=/foo/bar" |
| 21 | |
| 22 | // Check that omitting the equals works as well. |
| 23 | // RUN: %clang -### -triple x86_64-unknown-linux-gnu --sysroot /foo/bar \ |
| 24 | // RUN: -o /dev/null %s |& FileCheck %s -check-prefix=SYSROOT_SEPARATE |
| 25 | // SYSROOT_SEPARATE: "-isysroot" "/foo/bar" |
| 26 | // SYSROOT_SEPARATE: "--sysroot=/foo/bar" |