1 // REQUIRES
: !system-windows
3 // Test flush-denormals-to-zero enabled uses oclc_daz_opt_on
5 // RUN
: %clang -
### -target amdgcn-amd-amdhsa \
6 // RUN
: -x cl -mcpu
=gfx900 \
7 // RUN
: --rocm-path
=%S
/Inputs
/rocm \
9 // RUN
: 2>&1 | FileCheck --check-prefixes
=COMMON
,COMMON-DEFAULT
,GFX900-DEFAULT
,GFX900
,WAVE64 %s
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 \
18 // RUN
: 2>&1 | FileCheck --check-prefixes
=COMMON
,COMMON-DEFAULT
,GFX803-DEFAULT
,GFX803
,WAVE64 %s
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 \
27 // RUN
: 2>&1 | FileCheck --check-prefixes
=COMMON
,COMMON-DEFAULT
,GFX803-DEFAULT
,GFX803
,WAVE64 %s
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 \
36 // RUN
: 2>&1 | FileCheck --check-prefixes
=COMMON
,COMMON-DAZ
,GFX900
,WAVE64 %s
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 \
44 // RUN
: 2>&1 | FileCheck --check-prefixes
=COMMON
,COMMON-DAZ
,GFX803
,WAVE64 %s
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 \
53 // RUN
: 2>&1 | FileCheck --check-prefixes
=COMMON
,COMMON-FINITE-ONLY
,GFX803
,WAVE64 %s
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 \
62 // RUN
: 2>&1 | FileCheck --check-prefixes
=COMMON
,COMMON-CORRECT-SQRT
,GFX803
,WAVE64 %s
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 \
71 // RUN
: 2>&1 | FileCheck --check-prefixes
=COMMON
,COMMON-FAST-RELAXED
,GFX803
,WAVE64 %s
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 \
80 // RUN
: FileCheck --check-prefixes
=COMMON
,GFX803
,WAVE64 %s
82 // RUN
: %clang -
### -target amdgcn-amd-amdhsa \
83 // RUN
: -x cl -mcpu
=gfx1010 \
84 // RUN
: --rocm-path
=%S
/Inputs
/rocm \
86 // RUN
: FileCheck --check-prefix
=WAVE32 %s
88 // RUN
: %clang -
### -target amdgcn-amd-amdhsa \
89 // RUN
: -x cl -mcpu
=gfx1011 \
90 // RUN
: --rocm-path
=%S
/Inputs
/rocm \
92 // RUN
: FileCheck --check-prefix
=WAVE32 %s
94 // RUN
: %clang -
### -target amdgcn-amd-amdhsa \
95 // RUN
: -x cl -mcpu
=gfx1012 \
96 // RUN
: --rocm-path
=%S
/Inputs
/rocm \
98 // RUN
: FileCheck --check-prefix
=WAVE32 %s
101 // RUN
: %clang -
### -target amdgcn-amd-amdhsa \
102 // RUN
: -x cl -mcpu
=gfx1010 -mwavefrontsize64 \
103 // RUN
: --rocm-path
=%S
/Inputs
/rocm \
105 // RUN
: FileCheck --check-prefix
=WAVE64 %s
107 // RUN
: %clang -
### -target amdgcn-amd-amdhsa \
108 // RUN
: -x cl -mcpu
=gfx1010 -mwavefrontsize64 -mno-wavefrontsize64 \
109 // RUN
: --rocm-path
=%S
/Inputs
/rocm \
111 // RUN
: FileCheck --check-prefix
=WAVE32 %s
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 \
118 // RUN
: FileCheck --check-prefixes
=GFX803
,WAVE64 %s
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-DEFAULT
,GFX900
,WAVE64 %s
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-DEFAULT
,GFX900
,WAVE64 %s
135 // RUN
: %clang -
### -target amdgcn-amd-amdhsa \
136 // RUN
: -x cl -mcpu
=gfx908
:xnack
+ -fsanitize
=address \
137 // RUN
: --rocm-path
=%S
/Inputs
/rocm \
139 // RUN
: 2>&1 | FileCheck --check-prefixes
=ASAN
,COMMON %s
141 // RUN
: %clang -
### -target amdgcn-amd-amdhsa \
142 // RUN
: -x cl -mcpu
=gfx908
:xnack
+ \
143 // RUN
: --rocm-path
=%S
/Inputs
/rocm \
145 // RUN
: 2>&1 | FileCheck --check-prefixes
=NOASAN %s
147 // COMMON
: "-triple" "amdgcn-amd-amdhsa"
148 // ASAN-SAME
: "-mlink-bitcode-file" "{{.*}}/amdgcn/bitcode/asanrtl.bc"
149 // COMMON-SAME
: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/opencl.bc"
150 // COMMON-SAME
: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/ocml.bc"
151 // COMMON-SAME
: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/ockl.bc"
153 // GFX900-DEFAULT-SAME
: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_daz_opt_off.bc"
154 // GFX803-DEFAULT-SAME
: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_daz_opt_on.bc"
155 // GFX700-DEFAULT-SAME
: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_daz_opt_on.bc"
156 // COMMON-DAZ-SAME
: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_daz_opt_on.bc"
159 // COMMON-DEFAULT-SAME
: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_unsafe_math_off.bc"
160 // COMMON-DEFAULT-SAME
: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_finite_only_off.bc"
161 // COMMON-DEFAULT-SAME
: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_correctly_rounded_sqrt_off.bc"
164 // COMMON-FINITE-ONLY-SAME
: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_unsafe_math_off.bc"
165 // COMMON-FINITE-ONLY-SAME
: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_finite_only_on.bc"
166 // COMMON-FINITE-ONLY-SAME
: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_correctly_rounded_sqrt_off.bc"
169 // COMMON-CORRECT-SQRT-SAME
: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_unsafe_math_off.bc"
170 // COMMON-CORRECT-SQRT-SAME
: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_finite_only_off.bc"
171 // COMMON-CORRECT-SQRT-SAME
: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_correctly_rounded_sqrt_on.bc"
174 // COMMON-FAST-RELAXED-SAME
: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_unsafe_math_on.bc"
175 // COMMON-FAST-RELAXED-SAME
: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_finite_only_on.bc"
176 // COMMON-FAST-RELAXED-SAME
: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_correctly_rounded_sqrt_off.bc"
179 // COMMON-UNSAFE-MATH-SAME
: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_unsafe_math_on.bc"
180 // COMMON-UNSAFE-MATH-SAME
: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_finite_only_off.bc"
181 // COMMON-UNSAFE-MATH-SAME
: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_correctly_rounded_sqrt_off.bc"
183 // ASAN-SAME
: "-fsanitize=address"
185 // NOASAN-NOT
: "-fsanitize=address"
186 // NOASAN-NOT
: amdgcn
/bitcode
/asanrtl.bc
188 // WAVE64
: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_wavefrontsize64_on.bc"
189 // WAVE32
: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_wavefrontsize64_off.bc"
191 // GFX900
: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_isa_version_900.bc"
192 // GFX803
: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_isa_version_803.bc"
194 kernel void func
(void);