brintos

brintos / llvm-project-archived public Read only

0
0
Text · 11.7 KiB · effce40 Raw
257 lines · plain
1// Test if oclc_daz_opt_on or if oclc_daz_opt_off is linked depending on2// expected denormal mode.3 4// Test subtarget with flushing on by default.5// RUN: %clang -### --target=x86_64-linux-gnu \6// RUN:  --cuda-gpu-arch=gfx803 \7// RUN:  --rocm-path=%S/Inputs/rocm   \8// RUN:   %S/Inputs/hip_multiple_inputs/b.hip \9// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,FLUSHD,ROCMDIR10 11 12// Test subtarget with flushing off by ddefault.13// RUN: %clang -### --target=x86_64-linux-gnu \14// RUN:  --cuda-gpu-arch=gfx900 \15// RUN:  --rocm-path=%S/Inputs/rocm \16// RUN:   %S/Inputs/hip_multiple_inputs/b.hip \17// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,NOFLUSHD,ROCMDIR18 19 20// Test explicit flag, opposite of target default.21// RUN: %clang -### --target=x86_64-linux-gnu \22// RUN:   --cuda-gpu-arch=gfx900 \23// RUN:   -fgpu-flush-denormals-to-zero \24// RUN:   --rocm-path=%S/Inputs/rocm \25// RUN:   %S/Inputs/hip_multiple_inputs/b.hip \26// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,FLUSHD,ROCMDIR27 28 29// Test explicit flag, opposite of target default.30// RUN: %clang -### --target=x86_64-linux-gnu \31// RUN:   --cuda-gpu-arch=gfx803 \32// RUN:   -fno-gpu-flush-denormals-to-zero \33// RUN:   --rocm-path=%S/Inputs/rocm \34// RUN:   %S/Inputs/hip_multiple_inputs/b.hip \35// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,NOFLUSHD,ROCMDIR36 37 38// Test explicit flag, same as target default.39// RUN: %clang -### --target=x86_64-linux-gnu \40// RUN:   --cuda-gpu-arch=gfx900 \41// RUN:   -fno-gpu-flush-denormals-to-zero \42// RUN:   --rocm-path=%S/Inputs/rocm \43// RUN:   %S/Inputs/hip_multiple_inputs/b.hip \44// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,NOFLUSHD,ROCMDIR45 46 47// Test explicit flag, same as target default.48// RUN: %clang -### --target=x86_64-linux-gnu \49// RUN:   --cuda-gpu-arch=gfx803 \50// RUN:   -fgpu-flush-denormals-to-zero \51// RUN:   --rocm-path=%S/Inputs/rocm \52// RUN:   %S/Inputs/hip_multiple_inputs/b.hip \53// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,FLUSHD,ROCMDIR54 55 56// Test last flag wins, not flushing57// RUN: %clang -### --target=x86_64-linux-gnu \58// RUN:   --cuda-gpu-arch=gfx803 \59// RUN:   -fgpu-flush-denormals-to-zero -fno-gpu-flush-denormals-to-zero \60// RUN:   --rocm-path=%S/Inputs/rocm \61// RUN:   %S/Inputs/hip_multiple_inputs/b.hip \62// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,NOFLUSHD,ROCMDIR63 64 65// RUN: %clang -### --target=x86_64-linux-gnu \66// RUN:   --cuda-gpu-arch=gfx900 \67// RUN:   -fgpu-flush-denormals-to-zero -fno-gpu-flush-denormals-to-zero \68// RUN:   --rocm-path=%S/Inputs/rocm   \69// RUN:   %S/Inputs/hip_multiple_inputs/b.hip \70// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,NOFLUSHD,ROCMDIR71 72 73// RUN: %clang -### --target=x86_64-linux-gnu \74// RUN:   --cuda-gpu-arch=gfx900 \75// RUN:   -fno-gpu-flush-denormals-to-zero -fgpu-flush-denormals-to-zero \76// RUN:   --rocm-path=%S/Inputs/rocm   \77// RUN:   %S/Inputs/hip_multiple_inputs/b.hip \78// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,FLUSHD,ROCMDIR79 80 81// RUN: %clang -### --target=x86_64-linux-gnu \82// RUN:   --cuda-gpu-arch=gfx803 \83// RUN:   -fno-gpu-flush-denormals-to-zero -fgpu-flush-denormals-to-zero \84// RUN:   --rocm-path=%S/Inputs/rocm \85// RUN:   %S/Inputs/hip_multiple_inputs/b.hip \86// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,FLUSHD,ROCMDIR87 88// Test finding device lib in resource dir89// RUN: %clang -### --target=x86_64-linux-gnu \90// RUN:   --offload-arch=gfx803 -nogpuinc \91// RUN:   -resource-dir=%S/Inputs/rocm_resource_dir \92// RUN:   %S/Inputs/hip_multiple_inputs/b.hip \93// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,FLUSHD,RESDIR94 95// Test --hip-device-lib-path flag96// RUN: %clang -### --target=x86_64-linux-gnu \97// RUN:   --cuda-gpu-arch=gfx803 -nogpuinc \98// RUN:   --hip-device-lib-path=%S/Inputs/rocm/amdgcn/bitcode   \99// RUN:   %S/Inputs/hip_multiple_inputs/b.hip \100// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,FLUSHD,ROCMDIR101 102// Test --hip-device-lib-path wins over -resource-dir103// RUN: %clang -### --target=x86_64-linux-gnu \104// RUN:   --cuda-gpu-arch=gfx803 -nogpuinc \105// RUN:   --hip-device-lib-path=%S/Inputs/rocm/amdgcn/bitcode   \106// RUN:   -resource-dir=%S/Inputs/rocm_resource_dir \107// RUN:   %S/Inputs/hip_multiple_inputs/b.hip \108// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,FLUSHD,ROCMDIR109 110// Test environment variable HIP_DEVICE_LIB_PATH111// RUN: env HIP_DEVICE_LIB_PATH=%S/Inputs/rocm/amdgcn/bitcode \112// RUN:   %clang -### --target=x86_64-linux-gnu \113// RUN:   --cuda-gpu-arch=gfx900 -nogpuinc \114// RUN:   %S/Inputs/hip_multiple_inputs/b.hip \115// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,ROCMDIR116 117// Test environment variable HIP_DEVICE_LIB_PATH wins over -resource-dir118// RUN: env HIP_DEVICE_LIB_PATH=%S/Inputs/rocm/amdgcn/bitcode \119// RUN:   %clang -### --target=x86_64-linux-gnu \120// RUN:   --cuda-gpu-arch=gfx900 -nogpuinc \121// RUN:   -resource-dir=%S/Inputs/rocm_resource_dir \122// RUN:   %S/Inputs/hip_multiple_inputs/b.hip \123// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,ROCMDIR124 125// Test --gpu-instrument-lib126// RUN: %clang -### --target=x86_64-linux-gnu \127// RUN:   --cuda-gpu-arch=gfx900 \128// RUN:   --rocm-path=%S/Inputs/rocm \129// RUN:   --gpu-instrument-lib=%S/Inputs/hip_multiple_inputs/instrument.bc \130// RUN:   %S/Inputs/hip_multiple_inputs/b.hip \131// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,INST,ROCMDIR132 133// Test -fast-math134// RUN: %clang -### --target=x86_64-linux-gnu --offload-arch=gfx900 \135// RUN:   -ffast-math --rocm-path=%S/Inputs/rocm \136// RUN:   %S/Inputs/hip_multiple_inputs/b.hip \137// RUN: 2>&1 | FileCheck %s --check-prefixes=FAST138 139// Test -ffinite-math-only140// RUN: %clang -### --target=x86_64-linux-gnu --offload-arch=gfx900 \141// RUN:   -ffinite-math-only --rocm-path=%S/Inputs/rocm \142// RUN:   %S/Inputs/hip_multiple_inputs/b.hip \143// RUN: 2>&1 | FileCheck %s --check-prefixes=FINITE144 145// Test -funsafe-math-optimizations146// RUN: %clang -### --target=x86_64-linux-gnu --offload-arch=gfx900 \147// RUN:   -funsafe-math-optimizations --rocm-path=%S/Inputs/rocm \148// RUN:   %S/Inputs/hip_multiple_inputs/b.hip \149// RUN: 2>&1 | FileCheck %s --check-prefixes=UNSAFE150 151// Test -fno-hip-fp32-correctly-rounded-divide-sqrt152// RUN: %clang -### --target=x86_64-linux-gnu --offload-arch=gfx900 \153// RUN:   -fno-hip-fp32-correctly-rounded-divide-sqrt \154// RUN:   --rocm-path=%S/Inputs/rocm %S/Inputs/hip_multiple_inputs/b.hip \155// RUN: 2>&1 | FileCheck %s --check-prefixes=DIVSQRT156 157// Test default code object version.158// RUN: %clang -### --target=x86_64-linux-gnu --offload-arch=gfx900 \159// RUN:   --rocm-path=%S/Inputs/rocm %S/Inputs/hip_multiple_inputs/b.hip \160// RUN: 2>&1 | FileCheck %s --check-prefixes=ABI6161 162// Test default code object version with old device library without abi_version_400.bc163// RUN: %clang -### --target=x86_64-linux-gnu --offload-arch=gfx900 \164// RUN:   -mcode-object-version=4 \165// RUN:   --hip-device-lib-path=%S/Inputs/rocm/amdgcn/bitcode-no-abi-ver \166// RUN:   --rocm-path=%S/Inputs/rocm %S/Inputs/hip_multiple_inputs/b.hip \167// RUN: 2>&1 | FileCheck %s --check-prefixes=NOABI4168 169// Test -mcode-object-version=4170// RUN: %clang -### --target=x86_64-linux-gnu --offload-arch=gfx900 \171// RUN:   -mcode-object-version=4 \172// RUN:   --rocm-path=%S/Inputs/rocm %S/Inputs/hip_multiple_inputs/b.hip \173// RUN: 2>&1 | FileCheck %s --check-prefixes=ABI4174 175// Test -mcode-object-version=4 with old device library without abi_version_400.bc176// RUN: %clang -### --target=x86_64-linux-gnu --offload-arch=gfx900 \177// RUN:   -mcode-object-version=4 \178// RUN:   --hip-device-lib-path=%S/Inputs/rocm/amdgcn/bitcode-no-abi-ver   \179// RUN:   --rocm-path=%S/Inputs/rocm %S/Inputs/hip_multiple_inputs/b.hip \180// RUN: 2>&1 | FileCheck %s --check-prefixes=NOABI4181 182// Test -mcode-object-version=5183// RUN: %clang -### --target=x86_64-linux-gnu --offload-arch=gfx900 \184// RUN:   -mcode-object-version=5 \185// RUN:   --rocm-path=%S/Inputs/rocm %S/Inputs/hip_multiple_inputs/b.hip \186// RUN: 2>&1 | FileCheck %s --check-prefixes=ABI5187 188// Test -mcode-object-version=5 with old device library without abi_version_500.bc189// RUN: not %clang -### --target=x86_64-linux-gnu --offload-arch=gfx900 \190// RUN:   -mcode-object-version=5 \191// RUN:   --hip-device-lib-path=%S/Inputs/rocm/amdgcn/bitcode-no-abi-ver   \192// RUN:   --rocm-path=%S/Inputs/rocm %S/Inputs/hip_multiple_inputs/b.hip \193// RUN: 2>&1 | FileCheck %s --check-prefixes=NOABI5194 195// Test -mcode-object-version=6196// RUN: %clang -### --target=x86_64-linux-gnu --offload-arch=gfx900 \197// RUN:   -mcode-object-version=6 \198// RUN:   --rocm-path=%S/Inputs/rocm %S/Inputs/hip_multiple_inputs/b.hip \199// RUN: 2>&1 | FileCheck %s --check-prefixes=ABI6200 201// Test -mcode-object-version=6 with old device library without abi_version_600.bc202// RUN: not %clang -### --target=x86_64-linux-gnu --offload-arch=gfx900 \203// RUN:   -mcode-object-version=6 \204// RUN:   --hip-device-lib-path=%S/Inputs/rocm/amdgcn/bitcode-no-abi-ver   \205// RUN:   --rocm-path=%S/Inputs/rocm %S/Inputs/hip_multiple_inputs/b.hip \206// RUN: 2>&1 | FileCheck %s --check-prefixes=NOABI6207 208// ALL-NOT: error:209// ALL: {{"[^"]*clang[^"]*"}}210 211// RESDIR-SAME: "-mlink-builtin-bitcode" "[[DEVICELIB_DIR:[^"]+(/|\\\\)rocm_resource_dir(/|\\\\)lib(64)?(/|\\\\)amdgcn(/|\\\\).*]]ocml.bc"212// ROCMDIR-SAME: "-mlink-builtin-bitcode" "[[DEVICELIB_DIR:[^"]+(/|\\\\)rocm(/|\\\\)amdgcn(/|\\\\).*]]ocml.bc"213 214// ALL-SAME: "-mlink-builtin-bitcode" "[[DEVICELIB_DIR]]ockl.bc"215 216// FLUSHD-SAME: "-mlink-builtin-bitcode" "[[DEVICELIB_DIR]]oclc_daz_opt_on.bc"217// NOFLUSHD-SAME: "-mlink-builtin-bitcode" "[[DEVICELIB_DIR]]oclc_daz_opt_off.bc"218 219// ALL-SAME: "-mlink-builtin-bitcode" "[[DEVICELIB_DIR]]oclc_unsafe_math_off.bc"220// ALL-SAME: "-mlink-builtin-bitcode" "[[DEVICELIB_DIR]]oclc_finite_only_off.bc"221// ALL-SAME: "-mlink-builtin-bitcode" "[[DEVICELIB_DIR]]oclc_correctly_rounded_sqrt_on.bc"222// ALL-SAME: "-mlink-builtin-bitcode" "[[DEVICELIB_DIR]]oclc_wavefrontsize64_on.bc"223// ALL-SAME: "-mlink-builtin-bitcode" "[[DEVICELIB_DIR]]oclc_isa_version_{{[0-9]+}}.bc"224// INST-SAME: "-mlink-builtin-bitcode" "{{.*}}instrument.bc"225 226// FAST: "-mlink-builtin-bitcode" "{{.*}}oclc_daz_opt_off.bc"227// FAST-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_unsafe_math_on.bc"228// FAST-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_finite_only_on.bc"229// FAST-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_correctly_rounded_sqrt_on.bc"230 231// FINITE: "-mlink-builtin-bitcode" "{{.*}}oclc_daz_opt_off.bc"232// FINITE-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_unsafe_math_off.bc"233// FINITE-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_finite_only_on.bc"234// FINITE-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_correctly_rounded_sqrt_on.bc"235 236// UNSAFE: "-mlink-builtin-bitcode" "{{.*}}oclc_daz_opt_off.bc"237// UNSAFE-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_unsafe_math_on.bc"238// UNSAFE-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_finite_only_off.bc"239// UNSAFE-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_correctly_rounded_sqrt_on.bc"240 241// DIVSQRT: "-mlink-builtin-bitcode" "{{.*}}oclc_daz_opt_off.bc"242// DIVSQRT-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_unsafe_math_off.bc"243// DIVSQRT-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_finite_only_off.bc"244// DIVSQRT-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_correctly_rounded_sqrt_off.bc"245 246// ABI4-NOT: error:247// ABI4: "-mlink-builtin-bitcode" "{{.*}}oclc_abi_version_400.bc"248// ABI5-NOT: error:249// ABI5: "-mlink-builtin-bitcode" "{{.*}}oclc_abi_version_500.bc"250// ABI6-NOT: error:251// ABI6: "-mlink-builtin-bitcode" "{{.*}}oclc_abi_version_600.bc"252// NOABI4-NOT: error:253// NOABI4-NOT: "-mlink-builtin-bitcode" "{{.*}}oclc_abi_version_400.bc"254// NOABI4-NOT: "-mlink-builtin-bitcode" "{{.*}}oclc_abi_version_500.bc"255// NOABI5: error: cannot find ROCm device library for ABI version 5; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library256// NOABI6: error: cannot find ROCm device library for ABI version 6, which requires ROCm 6.3 or higher; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library257