[flang][cuda] Do not register global constants (#118582)
[llvm-project.git] / clang / test / Headers / __clang_hip_math_deprecated.hip
blobcaba3e9ad83d1879772f7d6417bc8bff37ac4dee
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // REQUIRES: amdgpu-registered-target
4 // RUN: %clang_cc1 -include __clang_hip_runtime_wrapper.h \
5 // RUN:   -internal-isystem %S/../../lib/Headers/cuda_wrappers \
6 // RUN:   -internal-isystem %S/Inputs/include \
7 // RUN:   -triple amdgcn-amd-amdhsa -aux-triple x86_64-unknown-unknown \
8 // RUN:   -target-cpu gfx906 -emit-llvm %s -fcuda-is-device -O1 -o - \
9 // RUN:   -D__HIPCC_RTC__ | FileCheck %s
11 // Test deprecated functions in the header that should be removed eventually
13 // CHECK-LABEL: @test_rcpf16_wrapper(
14 // CHECK-NEXT:  entry:
15 // CHECK-NEXT:    [[DIV_I:%.*]] = fdiv contract half 0xH3C00, [[X:%.*]]
16 // CHECK-NEXT:    ret half [[DIV_I]]
18 extern "C" __device__ _Float16 test_rcpf16_wrapper(_Float16 x) {
19   return __llvm_amdgcn_rcp_f16(x);
22 // CHECK-LABEL: @test_rcp2f16_wrapper(
23 // CHECK-NEXT:  entry:
24 // CHECK-NEXT:    [[DIV_I:%.*]] = fdiv contract <2 x half> splat (half 0xH3C00), [[X:%.*]]
25 // CHECK-NEXT:    ret <2 x half> [[DIV_I]]
27 extern "C" __device__ __2f16 test_rcp2f16_wrapper(__2f16 x) {
28   return __llvm_amdgcn_rcp_2f16(x);