| 1 |
// REQUIRES: !system-windows |
| 2 |
|
| 3 |
// Test flush-denormals-to-zero enabled uses oclc_daz_opt_on |
| 4 |
|
| 5 |
// RUN: %clang -### -target amdgcn-amd-amdhsa \ |
| 6 |
// RUN: -x cl -mcpu=gfx900 \ |
| 7 |
// RUN: --rocm-path=%S/Inputs/rocm \ |
| 8 |
// RUN: %s \ |
| 9 |
// RUN: 2>&1 | FileCheck --check-prefixes=COMMON,COMMON-DEFAULT,GFX900,WAVE64 %s |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
// Make sure the different denormal default is respected for gfx8 |
| 14 |
// RUN: %clang -### -target amdgcn-amd-amdhsa \ |
| 15 |
// RUN: -x cl -mcpu=gfx803 \ |
| 16 |
// RUN: --rocm-path=%S/Inputs/rocm \ |
| 17 |
// RUN: %s \ |
| 18 |
// RUN: 2>&1 | FileCheck --check-prefixes=COMMON,COMMON-DEFAULT,GFX803,WAVE64 %s |
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
// Make sure the non-canonical name works |
| 23 |
// RUN: %clang -### -target amdgcn-amd-amdhsa \ |
| 24 |
// RUN: -x cl -mcpu=fiji \ |
| 25 |
// RUN: --rocm-path=%S/Inputs/rocm \ |
| 26 |
// RUN: %s \ |
| 27 |
// RUN: 2>&1 | FileCheck --check-prefixes=COMMON,COMMON-DEFAULT,GFX803,WAVE64 %s |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
// RUN: %clang -### -target amdgcn-amd-amdhsa \ |
| 32 |
// RUN: -x cl -mcpu=gfx900 \ |
| 33 |
// RUN: -cl-denorms-are-zero \ |
| 34 |
// RUN: --rocm-path=%S/Inputs/rocm \ |
| 35 |
// RUN: %s \ |
| 36 |
// RUN: 2>&1 | FileCheck --check-prefixes=COMMON,GFX900,WAVE64 %s |
| 37 |
|
| 38 |
|
| 39 |
// RUN: %clang -### -target amdgcn-amd-amdhsa \ |
| 40 |
// RUN: -x cl -mcpu=gfx803 \ |
| 41 |
// RUN: -cl-denorms-are-zero \ |
| 42 |
// RUN: --rocm-path=%S/Inputs/rocm \ |
| 43 |
// RUN: %s \ |
| 44 |
// RUN: 2>&1 | FileCheck --check-prefixes=COMMON,GFX803,WAVE64 %s |
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
// RUN: %clang -### -target amdgcn-amd-amdhsa \ |
| 49 |
// RUN: -x cl -mcpu=gfx803 \ |
| 50 |
// RUN: -cl-finite-math-only \ |
| 51 |
// RUN: --rocm-path=%S/Inputs/rocm \ |
| 52 |
// RUN: %s \ |
| 53 |
// RUN: 2>&1 | FileCheck --check-prefixes=COMMON,COMMON-FINITE-ONLY,GFX803,WAVE64 %s |
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
// RUN: %clang -### -target amdgcn-amd-amdhsa \ |
| 58 |
// RUN: -x cl -mcpu=gfx803 \ |
| 59 |
// RUN: -cl-fp32-correctly-rounded-divide-sqrt \ |
| 60 |
// RUN: --rocm-path=%S/Inputs/rocm \ |
| 61 |
// RUN: %s \ |
| 62 |
// RUN: 2>&1 | FileCheck --check-prefixes=COMMON,COMMON-CORRECT-SQRT,GFX803,WAVE64 %s |
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
// RUN: %clang -### -target amdgcn-amd-amdhsa \ |
| 67 |
// RUN: -x cl -mcpu=gfx803 \ |
| 68 |
// RUN: -cl-fast-relaxed-math \ |
| 69 |
// RUN: --rocm-path=%S/Inputs/rocm \ |
| 70 |
// RUN: %s \ |
| 71 |
// RUN: 2>&1 | FileCheck --check-prefixes=COMMON,COMMON-FAST-RELAXED,GFX803,WAVE64 %s |
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
// RUN: %clang -### -target amdgcn-amd-amdhsa \ |
| 76 |
// RUN: -x cl -mcpu=gfx803 \ |
| 77 |
// RUN: -cl-unsafe-math-optimizations \ |
| 78 |
// RUN: --rocm-path=%S/Inputs/rocm \ |
| 79 |
// RUN: %s 2>&1 | \ |
| 80 |
// RUN: FileCheck --check-prefixes=COMMON,GFX803,WAVE64 %s |
| 81 |
|
| 82 |
// RUN: %clang -### -target amdgcn-amd-amdhsa \ |
| 83 |
// RUN: -x cl -mcpu=gfx1010 \ |
| 84 |
// RUN: --rocm-path=%S/Inputs/rocm \ |
| 85 |
// RUN: %s 2>&1 | \ |
| 86 |
// RUN: FileCheck --check-prefix=WAVE32 %s |
| 87 |
|
| 88 |
// RUN: %clang -### -target amdgcn-amd-amdhsa \ |
| 89 |
// RUN: -x cl -mcpu=gfx1011 \ |
| 90 |
// RUN: --rocm-path=%S/Inputs/rocm \ |
| 91 |
// RUN: %s 2>&1 | \ |
| 92 |
// RUN: FileCheck --check-prefix=WAVE32 %s |
| 93 |
|
| 94 |
// RUN: %clang -### -target amdgcn-amd-amdhsa \ |
| 95 |
// RUN: -x cl -mcpu=gfx1012 \ |
| 96 |
// RUN: --rocm-path=%S/Inputs/rocm \ |
| 97 |
// RUN: %s 2>&1 | \ |
| 98 |
// RUN: FileCheck --check-prefix=WAVE32 %s |
| 99 |
|
| 100 |
|
| 101 |
// RUN: %clang -### -target amdgcn-amd-amdhsa \ |
| 102 |
// RUN: -x cl -mcpu=gfx1010 -mwavefrontsize64 \ |
| 103 |
// RUN: --rocm-path=%S/Inputs/rocm \ |
| 104 |
// RUN: %s 2>&1 | \ |
| 105 |
// RUN: FileCheck --check-prefix=WAVE64 %s |
| 106 |
|
| 107 |
// RUN: %clang -### -target amdgcn-amd-amdhsa \ |
| 108 |
// RUN: -x cl -mcpu=gfx1010 -mwavefrontsize64 -mno-wavefrontsize64 \ |
| 109 |
// RUN: --rocm-path=%S/Inputs/rocm \ |
| 110 |
// RUN: %s 2>&1 | \ |
| 111 |
// RUN: FileCheck --check-prefix=WAVE32 %s |
| 112 |
|
| 113 |
// Ignore -mno-wavefrontsize64 without wave32 support |
| 114 |
// RUN: %clang -### -target amdgcn-amd-amdhsa \ |
| 115 |
// RUN: -x cl -mcpu=gfx803 -mno-wavefrontsize64 \ |
| 116 |
// RUN: --rocm-path=%S/Inputs/rocm \ |
| 117 |
// RUN: %s 2>&1 | \ |
| 118 |
// RUN: FileCheck --check-prefixes=GFX803,WAVE64 %s |
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
// Test --hip-device-lib-path format |
| 123 |
// RUN: %clang -### -target amdgcn-amd-amdhsa \ |
| 124 |
// RUN: -x cl -mcpu=gfx900 \ |
| 125 |
// RUN: --hip-device-lib-path=%S/Inputs/rocm/amdgcn/bitcode \ |
| 126 |
// RUN: %S/opencl.cl \ |
| 127 |
// RUN: 2>&1 | FileCheck --check-prefixes=COMMON,COMMON-DEFAULT,GFX900,WAVE64 %s |
| 128 |
|
| 129 |
// Test environment variable HIP_DEVICE_LIB_PATH |
| 130 |
// RUN: env HIP_DEVICE_LIB_PATH=%S/Inputs/rocm/amdgcn/bitcode %clang -### -target amdgcn-amd-amdhsa \ |
| 131 |
// RUN: -x cl -mcpu=gfx900 \ |
| 132 |
// RUN: %S/opencl.cl \ |
| 133 |
// RUN: 2>&1 | FileCheck --check-prefixes=COMMON,COMMON-DEFAULT,GFX900,WAVE64 %s |
| 134 |
|
| 135 |
// RUN: %clang -### -target amdgcn-amd-amdhsa \ |
| 136 |
// RUN: -x cl -mcpu=gfx908:xnack+ -fsanitize=address \ |
| 137 |
// RUN: --rocm-path=%S/Inputs/rocm \ |
| 138 |
// RUN: %s \ |
| 139 |
// RUN: 2>&1 | FileCheck --check-prefixes=ASAN,COMMON %s |
| 140 |
|
| 141 |
// RUN: %clang -### -target amdgcn-amd-amdhsa \ |
| 142 |
// RUN: -x cl -mcpu=gfx1250 -fsanitize=address \ |
| 143 |
// RUN: --rocm-path=%S/Inputs/rocm \ |
| 144 |
// RUN: %s \ |
| 145 |
// RUN: 2>&1 | FileCheck --check-prefixes=ASAN,COMMON %s |
| 146 |
|
| 147 |
// RUN: %clang -### -target amdgcn-amd-amdhsa \ |
| 148 |
// RUN: -x cl -mcpu=gfx1251 -fsanitize=address \ |
| 149 |
// RUN: --rocm-path=%S/Inputs/rocm \ |
| 150 |
// RUN: %s \ |
| 151 |
// RUN: 2>&1 | FileCheck --check-prefixes=ASAN,COMMON %s |
| 152 |
|
| 153 |
// RUN: %clang -### -target amdgcn-amd-amdhsa \ |
| 154 |
// RUN: -x cl -mcpu=gfx908:xnack+ \ |
| 155 |
// RUN: --rocm-path=%S/Inputs/rocm \ |
| 156 |
// RUN: %s \ |
| 157 |
// RUN: 2>&1 | FileCheck --check-prefixes=NOASAN %s |
| 158 |
|
| 159 |
// COMMON: "-triple" "amdgcn-amd-amdhsa" |
| 160 |
// COMMON-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/opencl.bc" |
| 161 |
// ASAN-SAME: "-mlink-bitcode-file" "{{.*}}/amdgcn/bitcode/asanrtl.bc" |
| 162 |
// COMMON-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/ocml.bc" |
| 163 |
// COMMON-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/ockl.bc" |
| 164 |
|
| 165 |
|
| 166 |
// COMMON-DEFAULT-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_unsafe_math_off.bc" |
| 167 |
// COMMON-DEFAULT-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_finite_only_off.bc" |
| 168 |
// COMMON-DEFAULT-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_correctly_rounded_sqrt_off.bc" |
| 169 |
|
| 170 |
|
| 171 |
// COMMON-FINITE-ONLY-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_unsafe_math_off.bc" |
| 172 |
// COMMON-FINITE-ONLY-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_finite_only_on.bc" |
| 173 |
// COMMON-FINITE-ONLY-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_correctly_rounded_sqrt_off.bc" |
| 174 |
|
| 175 |
|
| 176 |
// COMMON-CORRECT-SQRT-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_unsafe_math_off.bc" |
| 177 |
// COMMON-CORRECT-SQRT-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_finite_only_off.bc" |
| 178 |
// COMMON-CORRECT-SQRT-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_correctly_rounded_sqrt_on.bc" |
| 179 |
|
| 180 |
|
| 181 |
// COMMON-FAST-RELAXED-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_unsafe_math_on.bc" |
| 182 |
// COMMON-FAST-RELAXED-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_finite_only_on.bc" |
| 183 |
// COMMON-FAST-RELAXED-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_correctly_rounded_sqrt_off.bc" |
| 184 |
|
| 185 |
|
| 186 |
// COMMON-UNSAFE-MATH-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_unsafe_math_on.bc" |
| 187 |
// COMMON-UNSAFE-MATH-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_finite_only_off.bc" |
| 188 |
// COMMON-UNSAFE-MATH-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_correctly_rounded_sqrt_off.bc" |
| 189 |
|
| 190 |
// ASAN-SAME: "-fsanitize=address" |
| 191 |
|
| 192 |
// NOASAN-NOT: "-fsanitize=address" |
| 193 |
// NOASAN-NOT: amdgcn/bitcode/asanrtl.bc |
| 194 |
|
| 195 |
// WAVE64: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_wavefrontsize64_on.bc" |
| 196 |
// WAVE32: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_wavefrontsize64_off.bc" |
| 197 |
|
| 198 |
// GFX900: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_isa_version_900.bc" |
| 199 |
// GFX803: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_isa_version_803.bc" |
| 200 |
|
| 201 |
kernel void func(void); |