brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.9 KiB · eda87d0 Raw
68 lines · plain
1// UNSUPPORTED: system-windows2 3// RUN:  touch %t.o4 5// Test HIP runtime lib args specified by --rocm-path.6// RUN: %clang -### --hip-link --target=x86_64-linux-gnu \7// RUN:   --rocm-path=%S/Inputs/rocm %t.o 2>&1 \8// RUN:   | FileCheck -check-prefixes=ROCM-PATH %s9 10// Test HIP runtime lib args specified by environment variable ROCM_PATH.11// RUN: env ROCM_PATH=%S/Inputs/rocm %clang -### --hip-link \12// RUN:   --target=x86_64-linux-gnu %t.o 2>&1 \13// RUN:   | FileCheck -check-prefixes=ROCM-PATH %s14 15// RUN: %clang -### --hip-link --target=x86_64-linux-gnu \16// RUN:   --rocm-path=%S/Inputs/rocm %t.o --offload-add-rpath 2>&1 \17// RUN:   | FileCheck -check-prefixes=ROCM-RPATH %s18 19// RUN: %clang -### --hip-link --target=x86_64-linux-gnu \20// RUN:   --rocm-path=%S/Inputs/rocm %t.o -frtlib-add-rpath 2>&1 \21// RUN:   | FileCheck -check-prefixes=ROCM-RPATH %s22 23// Test that a canonical HIP runtime path is passed to the -rpath flag24// RUN: %clang -### --hip-link --target=x86_64-linux-gnu \25// RUN:   --rocm-path=%S/Inputs/rocm/./bin/../include/../ %t.o -frtlib-add-rpath 2>&1 \26// RUN:   | FileCheck -check-prefixes=ROCM-RPATH-CANONICAL %s27 28// Test detecting latest /opt/rocm-{release} directory.29// RUN: rm -rf %t && mkdir -p %t/opt30// RUN: cp -r %S/Inputs/rocm %t/opt/rocm-3.9.0-123431// RUN: cp -r %S/Inputs/rocm %t/opt/rocm-3.10.032// RUN: %clang -### --hip-link --target=x86_64-linux-gnu \33// RUN:   --sysroot=%t %t.o 2>&1 \34// RUN:   | FileCheck -check-prefixes=ROCM-REL %s35 36// Test HIP runtime lib is not linked without --hip-link.37// RUN: %clang -### --target=x86_64-linux-gnu \38// RUN:   --rocm-path=%S/Inputs/rocm %t.o 2>&1 \39// RUN:   | FileCheck -check-prefixes=NOHIPRT %s40 41// Test HIP runtime lib is not linked with -nostdlib.42// RUN: %clang -### --hip-link -nostdlib --target=x86_64-linux-gnu \43// RUN:   --rocm-path=%S/Inputs/rocm %t.o 2>&1 \44// RUN:   | FileCheck -check-prefixes=NOHIPRT %s45 46// Test HIP runtime lib is not linked with -no-hip-rt.47// RUN: %clang -### --hip-link -no-hip-rt --target=x86_64-linux-gnu \48// RUN:   --rocm-path=%S/Inputs/rocm %t.o 2>&1 \49// RUN:   | FileCheck -check-prefixes=NOHIPRT %s50 51// Test HIP runtime lib is not linked with -r.52// RUN: %clang -### --hip-link -r --target=x86_64-linux-gnu \53// RUN:   --rocm-path=%S/Inputs/rocm %t.o 2>&1 \54// RUN:   | FileCheck -check-prefixes=NOHIPRT %s55 56// Test HIP runtime lib is linked without hip-link if there is HIP input file.57// RUN: %clang -### --target=x86_64-linux-gnu -nogpuinc -nogpulib \58// RUN:   --rocm-path=%S/Inputs/rocm %s 2>&1 \59// RUN:   | FileCheck -check-prefixes=ROCM-PATH %s60 61// ROCM-PATH: "-L[[HIPRT:.*/Inputs/rocm/lib]]" "-lamdhip64"62// ROCM-RPATH: "-L[[HIPRT:.*/Inputs/rocm/lib]]" "-rpath" "[[HIPRT]]" "-lamdhip64"63// ROCM-RPATH-CANONICAL: "-rpath" "{{.*/rocm/lib}}" "-lamdhip64"64// ROCM-REL: "-L[[HIPRT:.*/opt/rocm-3.10.0/lib]]" "-lamdhip64"65// NOHIPRT-NOT: "-L{{.*/Inputs/rocm/lib}}"66// NOHIPRT-NOT: "-rpath" "{{.*/Inputs/rocm/lib}}"67// NOHIPRT-NOT: "-lamdhip64"68