1*67e74705SXin Li // Check for proper handling of --sysroot and -isysroot flags. 2*67e74705SXin Li 3*67e74705SXin Li // RUN: %clang -### -fsyntax-only -isysroot /foo/bar %s 2>&1 | \ 4*67e74705SXin Li // RUN: FileCheck %s -check-prefix=ISYSROOT 5*67e74705SXin Li // ISYSROOT: "-isysroot" "{{[^"]*}}/foo/bar" 6*67e74705SXin Li 7*67e74705SXin Li // Check that we get both isysroot for headers, and pass --sysroot on to GCC to 8*67e74705SXin Li // produce the final binary. 9*67e74705SXin Li // RUN: %clang -### -target x86_64-unknown-linux-gnu \ 10*67e74705SXin Li // RUN: --sysroot=/foo/bar -o /dev/null %s 2>&1 | \ 11*67e74705SXin Li // RUN: FileCheck %s -check-prefix=SYSROOT_EQ 12*67e74705SXin Li // SYSROOT_EQ: "-isysroot" "{{[^"]*}}/foo/bar" 13*67e74705SXin Li // SYSROOT_EQ: "--sysroot{{" "|=}}{{[^"]*}}/foo/bar" 14*67e74705SXin Li 15*67e74705SXin Li // Check for overriding the header sysroot by providing both --sysroot and 16*67e74705SXin Li // -isysroot. 17*67e74705SXin Li // RUN: %clang -### -target x86_64-unknown-linux-gnu -isysroot /baz \ 18*67e74705SXin Li // RUN: --sysroot=/foo/bar -o /dev/null %s 2>&1 | FileCheck %s \ 19*67e74705SXin Li // RUN: -check-prefix=ISYSROOT_AND_SYSROOT 20*67e74705SXin Li // ISYSROOT_AND_SYSROOT: "-isysroot" "{{[^"]*}}/baz" 21*67e74705SXin Li // ISYSROOT_AND_SYSROOT: "--sysroot{{" "|=}}{{[^"]*}}/foo/bar" 22*67e74705SXin Li 23*67e74705SXin Li // Check that omitting the equals works as well. 24*67e74705SXin Li // RUN: %clang -### -target x86_64-unknown-linux-gnu \ 25*67e74705SXin Li // RUN: --sysroot /foo/bar -o /dev/null %s 2>&1 | \ 26*67e74705SXin Li // RUN: FileCheck %s -check-prefix=SYSROOT_SEPARATE 27*67e74705SXin Li // SYSROOT_SEPARATE: "-isysroot" "{{[^"]*}}/foo/bar" 28*67e74705SXin Li // SYSROOT_SEPARATE: "--sysroot{{" "|=}}{{[^"]*}}/foo/bar" 29