2010-10-20 15:00:47 +08:00
|
|
|
// Check for proper handling of --sysroot and -isysroot flags.
|
|
|
|
|
2010-10-20 15:16:18 +08:00
|
|
|
// RUN: %clang -### -fsyntax-only -isysroot /foo/bar %s 2>&1 | \
|
2010-10-20 15:00:47 +08:00
|
|
|
// RUN: FileCheck %s -check-prefix=ISYSROOT
|
2011-03-18 11:21:33 +08:00
|
|
|
// ISYSROOT: "-isysroot" "{{[^"]*}}/foo/bar"
|
2010-10-20 15:00:47 +08:00
|
|
|
|
|
|
|
// Check that we get both isysroot for headers, and pass --sysroot on to GCC to
|
|
|
|
// produce the final binary.
|
2012-01-14 05:33:06 +08:00
|
|
|
// RUN: %clang -### -ccc-host-triple x86_64-unknown-linux-gnu \
|
2010-10-20 16:24:03 +08:00
|
|
|
// RUN: --sysroot=/foo/bar -o /dev/null %s 2>&1 | \
|
|
|
|
// RUN: FileCheck %s -check-prefix=SYSROOT_EQ
|
2011-03-18 11:21:33 +08:00
|
|
|
// SYSROOT_EQ: "-isysroot" "{{[^"]*}}/foo/bar"
|
|
|
|
// SYSROOT_EQ: "--sysroot{{" "|=}}{{[^"]*}}/foo/bar"
|
2010-10-20 15:00:47 +08:00
|
|
|
|
|
|
|
// Check for overriding the header sysroot by providing both --sysroot and
|
|
|
|
// -isysroot.
|
2012-01-14 05:33:06 +08:00
|
|
|
// RUN: %clang -### -ccc-host-triple x86_64-unknown-linux-gnu -isysroot /baz \
|
2010-10-20 15:16:18 +08:00
|
|
|
// RUN: --sysroot=/foo/bar -o /dev/null %s 2>&1 | FileCheck %s \
|
2010-10-20 15:00:47 +08:00
|
|
|
// RUN: -check-prefix=ISYSROOT_AND_SYSROOT
|
2011-03-18 11:21:33 +08:00
|
|
|
// ISYSROOT_AND_SYSROOT: "-isysroot" "{{[^"]*}}/baz"
|
|
|
|
// ISYSROOT_AND_SYSROOT: "--sysroot{{" "|=}}{{[^"]*}}/foo/bar"
|
2010-10-20 15:00:47 +08:00
|
|
|
|
|
|
|
// Check that omitting the equals works as well.
|
2012-01-14 05:33:06 +08:00
|
|
|
// RUN: %clang -### -ccc-host-triple x86_64-unknown-linux-gnu \
|
2010-10-20 16:24:03 +08:00
|
|
|
// RUN: --sysroot /foo/bar -o /dev/null %s 2>&1 | \
|
|
|
|
// RUN: FileCheck %s -check-prefix=SYSROOT_SEPARATE
|
2011-03-18 11:21:33 +08:00
|
|
|
// SYSROOT_SEPARATE: "-isysroot" "{{[^"]*}}/foo/bar"
|
|
|
|
// SYSROOT_SEPARATE: "--sysroot{{" "|=}}{{[^"]*}}/foo/bar"
|