brintos

brintos / llvm-project-archived public Read only

0
0
Text · 8.7 KiB · e791353 Raw
156 lines · c
1// UNSUPPORTED: system-windows2 3// -----------------------------------------------------------------------------4// Passing --musl5// -----------------------------------------------------------------------------6// RUN: %clang -### --target=hexagon-unknown-linux-musl \7// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \8// RUN:   -mcpu=hexagonv60 \9// RUN:   -fuse-ld=lld \10// RUN:   --sysroot=%S/Inputs/basic_linux_libcxx_tree %s 2>&1 | FileCheck -check-prefix=CHECK000 %s11// CHECK000-NOT:  {{.*}}basic_linux_libcxx_tree{{/|\\\\}}usr{{/|\\\\}}lib{{/|\\\\}}crti.o12// CHECK000:      "-dynamic-linker={{/|\\\\}}lib{{/|\\\\}}ld-musl-hexagon.so.1"13// CHECK000:      "{{.*}}basic_linux_libcxx_tree{{/|\\\\}}usr{{/|\\\\}}lib{{/|\\\\}}crt1.o"14// CHECK000:      "-lc" "-lclang_rt.builtins-hexagon"15// -----------------------------------------------------------------------------16// Passing --musl --shared17// -----------------------------------------------------------------------------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 %s 2>&1 | FileCheck -check-prefix=CHECK001 %s22// CHECK001-NOT:    -dynamic-linker={{/|\\\\}}lib{{/|\\\\}}ld-musl-hexagon.so.123// CHECK001:        "{{.*}}basic_linux_libcxx_tree{{/|\\\\}}usr{{/|\\\\}}lib{{/|\\\\}}crti.o"24// CHECK001:        "-lc" "-lclang_rt.builtins-hexagon"25// CHECK001-NOT:    {{.*}}basic_linux_libcxx_tree{{/|\\\\}}usr{{/|\\\\}}lib{{/|\\\\}}crt1.o26// -----------------------------------------------------------------------------27// Passing --musl -nostdlib28// -----------------------------------------------------------------------------29// RUN: %clang -### --target=hexagon-unknown-linux-musl \30// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \31// RUN:   -mcpu=hexagonv60 \32// RUN:   --sysroot=%S/Inputs/basic_linux_libcxx_tree -nostdlib %s 2>&1 | FileCheck -check-prefix=CHECK002 %s33// CHECK002:       "-dynamic-linker={{/|\\\\}}lib{{/|\\\\}}ld-musl-hexagon.so.1"34// CHECK002-NOT:   {{.*}}basic_linux_libcxx_tree{{/|\\\\}}usr{{/|\\\\}}lib{{/|\\\\}}crti.o35// CHECK002-NOT:   {{.*}}basic_linux_libcxx_tree{{/|\\\\}}usr{{/|\\\\}}lib{{/|\\\\}}crt1.o36// CHECK002-NOT:   "-lc"37// CHECK002-NOT:   "-lclang_rt.builtins-hexagon"38// -----------------------------------------------------------------------------39// Passing --musl -nostartfiles40// -----------------------------------------------------------------------------41// RUN: %clang -### --target=hexagon-unknown-linux-musl \42// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \43// RUN:   -mcpu=hexagonv60 \44// RUN:   --sysroot=%S/Inputs/basic_linux_libcxx_tree -nostartfiles %s 2>&1 | FileCheck -check-prefix=CHECK003 %s45// CHECK003:       "-dynamic-linker={{/|\\\\}}lib{{/|\\\\}}ld-musl-hexagon.so.1"46// CHECK003-NOT:   {{.*}}basic_linux_libcxx_tree{{/|\\\\}}usr{{/|\\\\}}lib{{/|\\\\}}Scrt1.o47// CHECK003-NOT:   {{.*}}basic_linux_libcxx_tree{{/|\\\\}}usr{{/|\\\\}}lib{{/|\\\\}}crt1.o48// CHECK003:       "-lc" "-lclang_rt.builtins-hexagon"49// -----------------------------------------------------------------------------50// Passing --musl -nodefaultlibs51// -----------------------------------------------------------------------------52// RUN: %clang -### --target=hexagon-unknown-linux-musl \53// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \54// RUN:   -mcpu=hexagonv60 \55// RUN:   --sysroot=%S/Inputs/basic_linux_libcxx_tree -nodefaultlibs %s 2>&1 | FileCheck -check-prefix=CHECK004 %s56// CHECK004:       "-dynamic-linker={{/|\\\\}}lib{{/|\\\\}}ld-musl-hexagon.so.1"57// CHECK004:       "{{.*}}basic_linux_libcxx_tree{{/|\\\\}}usr{{/|\\\\}}lib{{/|\\\\}}crt1.o"58// CHECK004-NOT:   "-lc"59// CHECK004-NOT:   "-lclang_rt.builtins-hexagon"60// -----------------------------------------------------------------------------61// Passing --musl -nolibc62// -----------------------------------------------------------------------------63// RUN: %clang -### --target=hexagon-unknown-linux-musl \64// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \65// RUN:   -mcpu=hexagonv60 --sysroot=%S/Inputs/basic_linux_libcxx_tree \66// RUN:   -nolibc %s 2>&1 | FileCheck -check-prefix=CHECK-NOLIBC %s67// CHECK-NOLIBC:       "-dynamic-linker={{/|\\\\}}lib{{/|\\\\}}ld-musl-hexagon.so.1"68// CHECK-NOLIBC-SAME:  "{{.*}}basic_linux_libcxx_tree{{/|\\\\}}usr{{/|\\\\}}lib{{/|\\\\}}crt1.o"69// CHECK-NOLIBC-NOT:   "-lc"70// -----------------------------------------------------------------------------71// Not Passing -fno-use-init-array when musl is selected72// -----------------------------------------------------------------------------73// RUN: %clang -### --target=hexagon-unknown-linux-musl \74// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \75// RUN:   -mcpu=hexagonv60 %s 2>&1 | FileCheck -check-prefix=CHECK005 %s76// CHECK005-NOT:          -fno-use-init-array77// -----------------------------------------------------------------------------78// -----------------------------------------------------------------------------79// c++ when musl is selected80// -----------------------------------------------------------------------------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 %s 2>&1 | FileCheck -check-prefix=CHECK006 %s85// CHECK006:          "-internal-isystem" "{{.*}}basic_linux_libcxx_tree{{/|\\\\}}usr{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}v1"86// -----------------------------------------------------------------------------87// c++ when musl is selected88// -----------------------------------------------------------------------------89// RUN: %clangxx -### --target=hexagon-unknown-elf \90// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \91// RUN:   -stdlib=libc++ \92// RUN:   -mcpu=hexagonv60 %s 2>&1 | FileCheck -check-prefix=CHECK007 %s93// CHECK007:   "-internal-isystem" "{{.*}}hexagon{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}v1"94// -----------------------------------------------------------------------------95// internal-isystem for linux with and without musl96// -----------------------------------------------------------------------------97// RUN: %clang -### --target=hexagon-unknown-linux-musl \98// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \99// RUN:   -resource-dir=%S/Inputs/resource_dir %s 2>&1 | FileCheck -check-prefix=CHECK008 %s100// CHECK008:   InstalledDir: [[INSTALLED_DIR:.+]]101// CHECK008:   "-resource-dir" "[[RESOURCE:[^"]+]]"102// CHECK008-SAME: {{^}} "-internal-isystem" "[[RESOURCE]]/include"103// CHECK008-SAME: {{^}} "-internal-externc-isystem" "[[INSTALLED_DIR]]/../target/hexagon/include"104 105// RUN: %clang -### --target=hexagon-unknown-linux \106// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \107// RUN:   -resource-dir=%S/Inputs/resource_dir %s 2>&1 | FileCheck -check-prefix=CHECK009 %s108// CHECK009:   InstalledDir: [[INSTALLED_DIR:.+]]109// CHECK009:   "-resource-dir" "[[RESOURCE:[^"]+]]"110// CHECK009-SAME: {{^}} "-internal-isystem" "[[RESOURCE]]/include"111// CHECK009-SAME: {{^}} "-internal-externc-isystem" "[[INSTALLED_DIR]]/../target/hexagon/include"112 113// RUN: %clang -Werror -L/tmp \114// RUN:    --target=hexagon-unknown-linux-musl %s -### 2>&1 \115// RUN:    | FileCheck -check-prefix=CHECK010 %s116// CHECK010:   InstalledDir: [[INSTALLED_DIR:.+]]117// CHECK010-NOT:  "-lstandalone"118// CHECK010-NOT:  crt0_standalone.o119// CHECK010:   crt1.o120// CHECK010:   "-L/tmp"121// CHECK010-NOT:  "-lstandalone"122 123// -----------------------------------------------------------------------------124// unwindlib125// -----------------------------------------------------------------------------126// RUN: %clangxx --unwindlib=none \127// RUN:    --target=hexagon-unknown-linux-musl %s -### 2>&1 \128// RUN:    | FileCheck -check-prefix=CHECK011 %s129// CHECK011:   InstalledDir: [[INSTALLED_DIR:.+]]130// CHECK011:   "--eh-frame-hdr"131// CHECK011:   crt1.o132// CHECK011-NOT:  "-lunwind"133// CHECK011-NOT:  "-lgcc_eh"134// CHECK012-NOT:  "-lgcc_s"135 136 137// RUN: %clangxx --rtlib=compiler-rt --unwindlib=libunwind \138// RUN:    --target=hexagon-unknown-linux-musl %s -### 2>&1 \139// RUN:    | FileCheck -check-prefix=CHECK012 %s140// RUN: %clangxx \141// RUN:    --target=hexagon-unknown-linux-musl %s -### 2>&1 \142// RUN:    | FileCheck -check-prefix=CHECK012 %s143// CHECK012:   InstalledDir: [[INSTALLED_DIR:.+]]144// CHECK012:   crt1.o145// CHECK012:  "-lunwind"146// CHECK012-NOT:  "-lgcc_eh"147// CHECK012-NOT:  "-lgcc_s"148 149// RUN: not %clangxx --rtlib=compiler-rt --unwindlib=libgcc \150// RUN:    --target=hexagon-unknown-linux-musl %s -### 2>&1 \151// RUN:    | FileCheck -check-prefix=CHECK013 %s152// CHECK013:  error: unsupported unwind library 'libgcc' for platform 'hexagon-unknown-linux-musl'153// CHECK013-NOT:  "-lgcc_eh"154// CHECK013-NOT:  "-lgcc_s"155// CHECK013-NOT:  "-lunwind"156