| 1 |
// UNSUPPORTED: system-windows |
| 2 |
|
| 3 |
// Test that when a --sysroot is not provided, driver picks the default |
| 4 |
// location correctly if available. |
| 5 |
|
| 6 |
// RUN: rm -rf %t.dir/baremetal_default_sysroot |
| 7 |
// RUN: mkdir -p %t.dir/baremetal_default_sysroot/bin |
| 8 |
// RUN: mkdir -p %t.dir/baremetal_default_sysroot/lib/clang-runtimes/armv6m-none-eabi |
| 9 |
// RUN: ln -s %clang %t.dir/baremetal_default_sysroot/bin/clang |
| 10 |
|
| 11 |
// RUN: %t.dir/baremetal_default_sysroot/bin/clang -no-canonical-prefixes %s -### -o %t.out 2>&1 \ |
| 12 |
// RUN: -target armv6m-none-eabi --sysroot= \ |
| 13 |
// RUN: | FileCheck --check-prefix=CHECK-V6M-C %s |
| 14 |
// CHECK-V6M-C: "{{.*}}clang{{.*}}" "-cc1" "-triple" "thumbv6m-unknown-none-eabi" |
| 15 |
// CHECK-V6M-C-SAME: "-internal-isystem" "{{.*}}/baremetal_default_sysroot{{[/\\]+}}bin{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+}}armv6m-none-eabi{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1" |
| 16 |
// CHECK-V6M-C-SAME: "-internal-isystem" "{{.*}}/baremetal_default_sysroot{{[/\\]+}}bin{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+}}armv6m-none-eabi{{[/\\]+}}include" |
| 17 |
// CHECK-V6M-C-SAME: "-x" "c++" "{{.*}}baremetal-sysroot.cpp" |
| 18 |
// CHECK-V6M-C-NEXT: "{{[^"]*}}ld{{(\.(lld|bfd|gold))?}}{{(\.exe)?}}" "-Bstatic" |
| 19 |
// CHECK-V6M-C-SAME: "crt0.o" |
| 20 |
// CHECK-V6M-C-SAME: "-L{{.*}}/baremetal_default_sysroot{{[/\\]+}}bin{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+}}armv6m-none-eabi{{[/\\]+}}lib" |
| 21 |
// CHECK-V6M-C-SAME: "{{.*}}.o" |
| 22 |
// CHECK-V6M-C-SAME: "{{[^"]*}}libclang_rt.builtins.a" |
| 23 |
// CHECK-V6M-C-SAME: "-lc" |
| 24 |
// CHECK-V6M-C-SAME: "-o" "{{.*}}.tmp.out" |