[OpenACC] Enable 'attach' clause for combined constructs
[llvm-project.git] / clang / test / CodeGenCUDA / bf16.cu
blobf794b83239f14acf181485abe0b4197b5333088d
1 // REQUIRES: nvptx-registered-target
2 // REQUIRES: x86-registered-target
4 // RUN: %clang_cc1 "-aux-triple" "x86_64-unknown-linux-gnu" "-triple" "nvptx64-nvidia-cuda" \
5 // RUN:    -fcuda-is-device "-aux-target-cpu" "x86-64" -O1 -S -o - %s | FileCheck %s
7 #include "Inputs/cuda.h"
9 // CHECK-LABEL: .visible .func _Z8test_argPDF16bDF16b(
10 // CHECK:        .param .b64 _Z8test_argPDF16bDF16b_param_0,
11 // CHECK:        .param .align 2 .b8 _Z8test_argPDF16bDF16b_param_1[2]
13 __device__ void test_arg(__bf16 *out, __bf16 in) {
14 // CHECK-DAG:     ld.param.u64  %[[A:rd[0-9]+]], [_Z8test_argPDF16bDF16b_param_0];
15 // CHECK-DAG:     ld.param.b16  %[[R:rs[0-9]+]], [_Z8test_argPDF16bDF16b_param_1];
16   __bf16 bf16 = in;
17   *out = bf16;
18 // CHECK:         st.b16         [%[[A]]], %[[R]]
19 // CHECK:         ret;
23 // CHECK-LABEL: .visible .func (.param .align 2 .b8 func_retval0[2]) _Z8test_retDF16b(
24 // CHECK:        .param .align 2 .b8 _Z8test_retDF16b_param_0[2]
25 __device__ __bf16 test_ret( __bf16 in) {
26 // CHECK:        ld.param.b16    %[[R:rs[0-9]+]], [_Z8test_retDF16b_param_0];
27   return in;
28 // CHECK:        st.param.b16    [func_retval0], %[[R]]
29 // CHECK:        ret;
32 __device__ __bf16 external_func( __bf16 in);
34 // CHECK-LABEL: .visible .func  (.param .align 2 .b8 func_retval0[2]) _Z9test_callDF16b(
35 // CHECK:        .param .align 2 .b8 _Z9test_callDF16b_param_0[2]
36 __device__ __bf16 test_call( __bf16 in) {
37 // CHECK:        ld.param.b16    %[[R:rs[0-9]+]], [_Z9test_callDF16b_param_0];
38 // CHECK:        st.param.b16    [param0], %[[R]];
39 // CHECK:        .param .align 2 .b8 retval0[2];
40 // CHECK:        call.uni (retval0),
41 // CHECK-NEXT:   _Z13external_funcDF16b,
42 // CHECK-NEXT:   (
43 // CHECK-NEXT:   param0
44 // CHECK-NEXT    );
45 // CHECK:        ld.param.b16    %[[RET:rs[0-9]+]], [retval0];
46   return external_func(in);
47 // CHECK:        st.param.b16    [func_retval0], %[[RET]]
48 // CHECK:        ret;