brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.2 KiB · 6606e19 Raw
87 lines · plain
1// Check clang unbundle the archive and link them by lld.2// If there is a directory which has the same name as the3// value of the '-l' option, it should not interfere with4// the discovery and unbundling of the archive.5 6// RUN: rm -rf %t hipBundled && mkdir %t hipBundled7// RUN: touch %t/dummy.bc8// RUN: llvm-ar cr %t/libhipBundled.a %t/dummy.bc9// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \10// RUN:   --no-offload-new-driver --target=x86_64-unknown-linux-gnu \11// RUN:   -nogpuinc -nogpulib %s -fgpu-rdc -L%t -lhipBundled \12// RUN:   2>&1 | FileCheck -check-prefixes=GNU,GNU1,GNU-L %s13 14// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 -nogpuinc \15// RUN:   --no-offload-new-driver --target=x86_64-unknown-linux-gnu \16// RUN:   -nogpuinc -nogpulib %s -fgpu-rdc -L%t -l:libhipBundled.a \17// RUN:   2>&1 | FileCheck -check-prefixes=GNU,GNU1,GNU-LA %s18 19// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \20// RUN:   --no-offload-new-driver --target=x86_64-unknown-linux-gnu \21// RUN:   -nogpuinc -nogpulib %s -fgpu-rdc %t/libhipBundled.a \22// RUN:   2>&1 | FileCheck -check-prefixes=GNU,GNU1,GNU-A %s23 24// RUN: llvm-ar cr %t/libhipBundled.a.5.2 %t/dummy.bc25// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \26// RUN:   --no-offload-new-driver --target=x86_64-unknown-linux-gnu \27// RUN:   -nogpuinc -nogpulib %s -fgpu-rdc %t/libhipBundled.a.5.2 \28// RUN:   2>&1 | FileCheck -check-prefixes=GNU,GNU2,GNU-A %s29 30// Check if a file is not an archive, it is not unbundled.31 32// RUN: touch %t/libNonArchive.a33// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \34// RUN:   --no-offload-new-driver --target=x86_64-unknown-linux-gnu \35// RUN:   -nogpuinc -nogpulib %s -fgpu-rdc -L%t -lNonArchive \36// RUN:   2>&1 | FileCheck -check-prefixes=NONARCHIVE %s37// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \38// RUN:   --no-offload-new-driver --target=x86_64-unknown-linux-gnu \39// RUN:   -nogpuinc -nogpulib %s -fgpu-rdc -L%t -l:libNonArchive.a \40// RUN:   2>&1 | FileCheck -check-prefixes=NONARCHIVE %s41// RUN: not %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \42// RUN:   --no-offload-new-driver --target=x86_64-unknown-linux-gnu \43// RUN:   -nogpuinc -nogpulib %s -fgpu-rdc -L%t libNonArchive.a \44// RUN:   2>&1 | FileCheck -check-prefixes=NONARCHIVE %s45 46// Check if a file does not exist, it is not unbundled.47 48// RUN: not %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \49// RUN:   --no-offload-new-driver --target=x86_64-unknown-linux-gnu \50// RUN:   -nogpuinc -nogpulib %s -fgpu-rdc %t/NoneExist.a \51// RUN:   2>&1 | FileCheck -check-prefixes=NONE %s52 53// Check unbundling archive for MSVC.54 55// RUN: llvm-ar cr %t/hipBundled2.lib %t/dummy.bc56// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \57// RUN:   --no-offload-new-driver --target=x86_64-pc-windows-msvc -fuse-ld= \58// RUN:   -nogpuinc -nogpulib %s -fgpu-rdc -L%t -lhipBundled2 \59// RUN:   2>&1 | FileCheck -check-prefix=MSVC %s60 61// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \62// RUN:   --no-offload-new-driver --target=x86_64-pc-windows-msvc -fuse-ld= \63// RUN:   -nogpuinc -nogpulib %s -fgpu-rdc -L%t -l:hipBundled2.lib \64// RUN:   2>&1 | FileCheck -check-prefix=MSVC %s65 66// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \67// RUN:   --no-offload-new-driver --target=x86_64-pc-windows-msvc -fuse-ld= \68// RUN:   -nogpuinc -nogpulib %s -fgpu-rdc %t/hipBundled2.lib \69// RUN:   2>&1 | FileCheck -check-prefix=MSVC %s70 71// GNU1: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*}}[[LIB:libhipBundled\.a]]" "-targets=hip-amdgcn-amd-amdhsa-unknown-gfx1030" "-output=[[A1030:.*\.a]]" "-allow-missing-bundles"72// GNU2: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*}}[[LIB:libhipBundled\.a\.5\.2]]" "-targets=hip-amdgcn-amd-amdhsa-unknown-gfx1030" "-output=[[A1030:.*\.a]]" "-allow-missing-bundles"73// GNU: "{{.*}}lld{{.*}}" {{.*}}"-plugin-opt=mcpu=gfx1030" {{.*}} "[[A1030]]"74// GNU: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*}}[[LIB]]" "-targets=hip-amdgcn-amd-amdhsa-unknown-gfx906" "-output=[[A906:.*\.a]]" "-allow-missing-bundles"75// GNU: "{{.*}}lld{{.*}}" {{.*}}"-plugin-opt=mcpu=gfx906" {{.*}} "[[A906]]"76// GNU-L: "{{.*}}ld{{.*}}" {{.*}}"-o" "a.out" {{.*}}"-lhipBundled"77// GNU-LA: "{{.*}}ld{{.*}}" {{.*}}"-o" "a.out" {{.*}}"-l:libhipBundled.a"78// GNU-A: "{{.*}}ld{{.*}}" {{.*}}"-o" "a.out" "{{.*}}[[LIB]]"79// NONARCHIVE-NOT: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*libNonArchive\.a}}"80// NONE-NOT: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*NoneExist\.a}}"81 82// MSVC: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*}}hipBundled2.lib" "-targets=hip-amdgcn-amd-amdhsa-unknown-gfx1030" "-output=[[A1030:.*\.a]]" "-allow-missing-bundles"83// MSVC: "{{.*}}lld{{.*}}" {{.*}}"-plugin-opt=mcpu=gfx1030" {{.*}} "[[A1030]]"84// MSVC: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*}}hipBundled2.lib" "-targets=hip-amdgcn-amd-amdhsa-unknown-gfx906" "-output=[[A906:.*\.a]]" "-allow-missing-bundles"85// MSVC: "{{.*}}lld{{.*}}" {{.*}}"-plugin-opt=mcpu=gfx906" {{.*}} "[[A906]]"86// MSVC: "{{.*}}link{{.*}}" {{.*}}"-out:a.exe" {{.*}}hipBundled2.lib"87