| 1 |
// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa \ |
| 2 |
// RUN: -fcuda-is-device -emit-llvm -o - -x hip %s \ |
| 3 |
// RUN: | FileCheck -check-prefixes=NO-UNSAFE-FP-ATOMICS %s |
| 4 |
// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa \ |
| 5 |
// RUN: -fcuda-is-device -emit-llvm -o - -x hip %s \ |
| 6 |
// RUN: -munsafe-fp-atomics \ |
| 7 |
// RUN: | FileCheck -check-prefixes=UNSAFE-FP-ATOMICS %s |
| 8 |
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm \ |
| 9 |
// RUN: -o - -x hip %s -munsafe-fp-atomics \ |
| 10 |
// RUN: | FileCheck -check-prefix=NO-UNSAFE-FP-ATOMICS %s |
| 11 |
|
| 12 |
#include "Inputs/cuda.h" |
| 13 |
|
| 14 |
__device__ void test() { |
| 15 |
// UNSAFE-FP-ATOMICS: define{{.*}} void @_Z4testv() [[ATTR:#[0-9]+]] |
| 16 |
} |
| 17 |
|
| 18 |
|
| 19 |
// Make sure this is silently accepted on other targets. |
| 20 |
// NO-UNSAFE-FP-ATOMICS-NOT: "amdgpu-unsafe-fp-atomics" |
| 21 |
|
| 22 |
// UNSAFE-FP-ATOMICS-DAG: attributes [[ATTR]] = {{.*}}"amdgpu-unsafe-fp-atomics"="true" |