1 // ----------------------------------------------------------------------------- 2 // Passing --musl 3 // ----------------------------------------------------------------------------- 4 // RUN: %clang -### -target hexagon-unknown-linux-musl \ 5 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 6 // RUN: -mcpu=hexagonv60 \ 7 // RUN: -fuse-ld=lld \ 8 // RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree \ 9 // RUN: %s 2>&1 \ 10 // RUN: | FileCheck -check-prefix=CHECK000 %s 11 // CHECK000-NOT: {{.*}}basic_linux_libcxx_tree{{/|\\\\}}usr{{/|\\\\}}lib{{/|\\\\}}crti.o 12 // CHECK000: "-dynamic-linker={{/|\\\\}}lib{{/|\\\\}}ld-musl-hexagon.so.1" 13 // CHECK000: "{{.*}}basic_linux_libcxx_tree{{/|\\\\}}usr{{/|\\\\}}lib{{/|\\\\}}crt1.o" 14 // CHECK000: "-lclang_rt.builtins-hexagon" "-lc" 15 // ----------------------------------------------------------------------------- 16 // Passing --musl --shared 17 // ----------------------------------------------------------------------------- 18 // RUN: %clang -### -target hexagon-unknown-linux-musl \ 19 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 20 // RUN: -mcpu=hexagonv60 \ 21 // RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree -shared \ 22 // RUN: %s 2>&1 \ 23 // RUN: | FileCheck -check-prefix=CHECK001 %s 24 // CHECK001-NOT: -dynamic-linker={{/|\\\\}}lib{{/|\\\\}}ld-musl-hexagon.so.1 25 // CHECK001: "{{.*}}basic_linux_libcxx_tree{{/|\\\\}}usr{{/|\\\\}}lib{{/|\\\\}}crti.o" 26 // CHECK001: "-lclang_rt.builtins-hexagon" "-lc" 27 // CHECK001-NOT: {{.*}}basic_linux_libcxx_tree{{/|\\\\}}usr{{/|\\\\}}lib{{/|\\\\}}crt1.o 28 // ----------------------------------------------------------------------------- 29 // Passing --musl -nostdlib 30 // ----------------------------------------------------------------------------- 31 // RUN: %clang -### -target hexagon-unknown-linux-musl \ 32 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 33 // RUN: -mcpu=hexagonv60 \ 34 // RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree -nostdlib \ 35 // RUN: %s 2>&1 \ 36 // RUN: | FileCheck -check-prefix=CHECK002 %s 37 // CHECK002: "-dynamic-linker={{/|\\\\}}lib{{/|\\\\}}ld-musl-hexagon.so.1" 38 // CHECK002-NOT: {{.*}}basic_linux_libcxx_tree{{/|\\\\}}usr{{/|\\\\}}lib{{/|\\\\}}crti.o 39 // CHECK002-NOT: {{.*}}basic_linux_libcxx_tree{{/|\\\\}}usr{{/|\\\\}}lib{{/|\\\\}}crt1.o 40 // CHECK002-NOT: -lclang_rt.builtins-hexagon 41 // CHECK002-NOT: -lc 42 // ----------------------------------------------------------------------------- 43 // Passing --musl -nostartfiles 44 // ----------------------------------------------------------------------------- 45 // RUN: %clang -### -target hexagon-unknown-linux-musl \ 46 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 47 // RUN: -mcpu=hexagonv60 \ 48 // RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree -nostartfiles \ 49 // RUN: %s 2>&1 \ 50 // RUN: | FileCheck -check-prefix=CHECK003 %s 51 // CHECK003: "-dynamic-linker={{/|\\\\}}lib{{/|\\\\}}ld-musl-hexagon.so.1" 52 // CHECK003-NOT: {{.*}}basic_linux_libcxx_tree{{/|\\\\}}usr{{/|\\\\}}lib{{/|\\\\}}Scrt1.o 53 // CHECK003-NOT: {{.*}}basic_linux_libcxx_tree{{/|\\\\}}usr{{/|\\\\}}lib{{/|\\\\}}crt1.o 54 // CHECK003: "-lclang_rt.builtins-hexagon" "-lc" 55 // ----------------------------------------------------------------------------- 56 // Passing --musl -nodefaultlibs 57 // ----------------------------------------------------------------------------- 58 // RUN: %clang -### -target hexagon-unknown-linux-musl \ 59 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 60 // RUN: -mcpu=hexagonv60 \ 61 // RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree -nodefaultlibs \ 62 // RUN: %s 2>&1 \ 63 // RUN: | FileCheck -check-prefix=CHECK004 %s 64 // CHECK004: "-dynamic-linker={{/|\\\\}}lib{{/|\\\\}}ld-musl-hexagon.so.1" 65 // CHECK004: "{{.*}}basic_linux_libcxx_tree{{/|\\\\}}usr{{/|\\\\}}lib{{/|\\\\}}crt1.o" 66 // CHECK004-NOT: -lclang_rt.builtins-hexagon 67 // CHECK004-NOT: -lc 68 // ----------------------------------------------------------------------------- 69 // Not Passing -fno-use-init-array when musl is selected 70 // ----------------------------------------------------------------------------- 71 // RUN: %clang -### -target hexagon-unknown-linux-musl \ 72 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 73 // RUN: -mcpu=hexagonv60 \ 74 // RUN: %s 2>&1 \ 75 // RUN: | FileCheck -check-prefix=CHECK005 %s 76 // CHECK005-NOT: -fno-use-init-array 77 // ----------------------------------------------------------------------------- 78 // ----------------------------------------------------------------------------- 79 // c++ when musl is selected 80 // ----------------------------------------------------------------------------- 81 // RUN: %clangxx -### -target hexagon-unknown-linux-musl \ 82 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 83 // RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree \ 84 // RUN: -mcpu=hexagonv60 \ 85 // RUN: %s 2>&1 \ 86 // RUN: | FileCheck -check-prefix=CHECK006 %s 87 // CHECK006: "-internal-isystem" "{{.*}}basic_linux_libcxx_tree{{/|\\\\}}usr{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}v1" 88 // ----------------------------------------------------------------------------- 89 // c++ when musl is selected 90 // ----------------------------------------------------------------------------- 91 // RUN: %clangxx -### -target hexagon-unknown-elf \ 92 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 93 // RUN: -stdlib=libc++ \ 94 // RUN: -mcpu=hexagonv60 \ 95 // RUN: %s 2>&1 \ 96 // RUN: | FileCheck -check-prefix=CHECK007 %s 97 // CHECK007: "-internal-isystem" "{{.*}}hexagon{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}v1" 98