brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.2 KiB · b28b2bc Raw
121 lines · plain
1// UNSUPPORTED: system-windows2 3// Make sure the appropriate device specific library is available.4 5// We don't include every target in the test directory, so just pick a valid6// target not included in the test.7 8// RUN: not %clang -### -v --target=x86_64-linux-gnu --cuda-gpu-arch=gfx902 \9// RUN:   --rocm-path=%S/Inputs/rocm %s 2>&1 \10// RUN:   | FileCheck -check-prefixes=COMMON,GFX902-DEFAULTLIBS %s11 12// Should not interpret -nostdlib as disabling offload libraries.13// RUN: not %clang -### -v --target=x86_64-linux-gnu --cuda-gpu-arch=gfx902 -nostdlib \14// RUN:   --rocm-path=%S/Inputs/rocm %s 2>&1 \15// RUN:   | FileCheck -check-prefixes=COMMON,GFX902-DEFAULTLIBS %s16 17// RUN: %clang -### -v -target x86_64-linux-gnu --cuda-gpu-arch=gfx902 -nogpulib \18// RUN:   --rocm-path=%S/Inputs/rocm %s 2>&1 \19// RUN:   | FileCheck -check-prefixes=COMMON,NODEFAULTLIBS %s20 21// Test environment variable ROCM_PATH.22// RUN: env ROCM_PATH=%S/Inputs/rocm %clang -### --target=x86_64-linux-gnu \23// RUN:   --print-rocm-search-dirs --offload-arch=gfx1010 %s 2>&1 \24// RUN:   | FileCheck -check-prefixes=ROCM-ENV %s25 26// Test interaction between environment variables HIP_PATH and ROCM_PATH.27// Device libs are found under ROCM_PATH. HIP include files and HIP runtime library28// are found under HIP_PATH.29 30// RUN: rm -rf %t/myhip31// RUN: mkdir -p %t/myhip32// RUN: cp -r %S/Inputs/rocm/bin %t/myhip33 34// Test HIP_PATH overrides ROCM_PATH.35// RUN: env ROCM_PATH=%S/Inputs/rocm HIP_PATH=%t/myhip \36// RUN:   %clang -### -target x86_64-linux-gnu --offload-arch=gfx1010 \37// RUN:   --print-rocm-search-dirs %s 2>&1 \38// RUN:   | FileCheck -check-prefixes=ROCM-ENV,HIP-PATH %s39 40// Test --hip-path overrides ROCM_PATH.41// RUN: env ROCM_PATH=%S/Inputs/rocm \42// RUN:   %clang -### -target x86_64-linux-gnu --offload-arch=gfx1010 \43// RUN:   --hip-path=%t/myhip \44// RUN:   --print-rocm-search-dirs %s 2>&1 \45// RUN:   | FileCheck -check-prefixes=ROCM-ENV,HIP-PATH %s46 47// Test --hip-path overrides --rocm-path.48// RUN: %clang -### -target x86_64-linux-gnu --offload-arch=gfx1010 \49// RUN:   --hip-path=%t/myhip --rocm-path=%S/Inputs/rocm \50// RUN:   --print-rocm-search-dirs %s 2>&1 \51// RUN:   | FileCheck -check-prefixes=ROCM-ENV,HIP-PATH %s52 53// Test HIP_PATH overrides --rocm-path.54// RUN: env HIP_PATH=%t/myhip %clang -### -target x86_64-linux-gnu --offload-arch=gfx1010 \55// RUN:   --rocm-path=%S/Inputs/rocm \56// RUN:   --print-rocm-search-dirs %s 2>&1 \57// RUN:   | FileCheck -check-prefixes=ROCM-ENV,HIP-PATH %s58 59// Test empty HIP_PATH does not override --rocm-path.60// RUN: env HIP_PATH= \61// RUN:   %clang -### -target x86_64-linux-gnu --offload-arch=gfx1010 \62// RUN:   --rocm-path=%S/Inputs/rocm --print-rocm-search-dirs %s 2>&1 \63// RUN:   | FileCheck -check-prefixes=ROCM-PATH %s64 65// Test --hip-path option overrides environment variable HIP_PATH.66 67// RUN: rm -rf %t/myhip68// RUN: rm -rf %t/myhip_nouse69// RUN: mkdir -p %t/myhip70// RUN: mkdir -p %t/myhip_nouse71// RUN: cp -r %S/Inputs/rocm/bin %t/myhip72// RUN: cp -r %S/Inputs/rocm/bin %t/myhip_nouse73// RUN: env ROCM_PATH=%S/Inputs/rocm HIP_PATH=%t/myhip_nouse \74// RUN:   %clang -### -target x86_64-linux-gnu --offload-arch=gfx1010 --hip-link \75// RUN:   --hip-path=%t/myhip --print-rocm-search-dirs %s 2>&1 \76// RUN:   | FileCheck -check-prefixes=ROCM-ENV,HIP-PATH %s77 78// Test detecting /usr directory.79// RUN: rm -rf %t/*80// RUN: cp -r %S/Inputs/rocm %t/usr81// RUN: mkdir -p %t/usr/share/hip82// RUN: mv %t/usr/bin/.hipVersion %t/usr/share/hip/version83// RUN: mkdir -p %t/usr/local84// RUN: %clang -### --target=x86_64-linux-gnu --offload-arch=gfx1010 --sysroot=%t \85// RUN:   --print-rocm-search-dirs --hip-link %s 2>&1 \86// RUN:   | FileCheck -check-prefixes=USR %s87 88// Test detecting latest /opt/rocm-{release} directory.89// RUN: rm -rf %t/*90// RUN: mkdir -p %t/opt91// RUN: cp -r %S/Inputs/rocm %t/opt/rocm-3.9.0-123492// RUN: cp -r %S/Inputs/rocm %t/opt/rocm-3.10.093// RUN: %clang -### --target=x86_64-linux-gnu --offload-arch=gfx1010 --sysroot=%t \94// RUN:   --print-rocm-search-dirs %s 2>&1 \95// RUN:   | FileCheck -check-prefixes=ROCM-REL %s96 97// GFX902-DEFAULTLIBS: error: cannot find ROCm device library for gfx902; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library98 99// NODEFAULTLIBS-NOT: error: cannot find100 101// COMMON: "-triple" "amdgcn-amd-amdhsa"102 103// ROCM-ENV: ROCm installation search path: [[ROCM_PATH:.*/Inputs/rocm]]104 105// HIP-PATH: "-mlink-builtin-bitcode" "[[ROCM_PATH]]/amdgcn/bitcode/oclc_isa_version_1010.bc"106// HIP-PATH: "-idirafter" "[[HIP_PATH:.*/myhip]]/include"107// HIP-PATH: "-L[[HIP_PATH]]/lib" {{.*}}"-lamdhip64"108 109// ROCM-PATH: ROCm installation search path: [[ROCM_PATH:.*/Inputs/rocm]]110// ROCM-PATH: "-mlink-builtin-bitcode" "[[ROCM_PATH]]/amdgcn/bitcode/oclc_isa_version_1010.bc"111// ROCM-PATH: "-idirafter" "[[ROCM_PATH]]/include"112// ROCM-PATH: "-L[[ROCM_PATH]]/lib" {{.*}}"-lamdhip64"113 114// USR: ROCm installation search path: [[ROCM_PATH:.*/usr$]]115// USR: "-mlink-builtin-bitcode" "[[ROCM_PATH]]/amdgcn/bitcode/oclc_isa_version_1010.bc"116// USR: "-idirafter" "[[ROCM_PATH]]/include"117// USR: "-L[[ROCM_PATH]]/lib" {{.*}}"-lamdhip64"118 119// ROCM-REL: ROCm installation search path: {{.*}}/opt/rocm120// ROCM-REL: ROCm installation search path: {{.*}}/opt/rocm-3.10.0121