brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 120b854 Raw
28 lines · plain
1// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --check-globals all --version 52// RUN: %clang_cc1 "-triple" "nvptx64-nvidia-cuda" -emit-llvm -fcuda-is-device -o - %s | FileCheck %s3 4#include "Inputs/cuda.h"5 6struct S {};7 8__global__ void kernel(__grid_constant__ const S gc_arg1, int arg2, __grid_constant__ const int gc_arg3) {}9 10// dependent arguments get diagnosed after instantiation.11template <typename T>12__global__ void tkernel_const(__grid_constant__ const T arg) {}13 14template <typename T>15__global__ void tkernel(int dummy, __grid_constant__ T arg) {}16 17void foo() {18  tkernel_const<const S><<<1,1>>>({});19  tkernel_const<S><<<1,1>>>({});20  tkernel<const S><<<1,1>>>(1, {});21}22 23// CHECK: define dso_local ptx_kernel void @_Z6kernel1Sii(ptr noundef byval(%struct.S) align 1 "nvvm.grid_constant" %gc_arg1, i32 noundef %arg2, i32 noundef "nvvm.grid_constant" %gc_arg3)24// CHECK: define ptx_kernel void @_Z13tkernel_constIK1SEvT_(ptr noundef byval(%struct.S) align 1 "nvvm.grid_constant" %arg)25// CHECK: define ptx_kernel void @_Z13tkernel_constI1SEvT_(ptr noundef byval(%struct.S) align 1 "nvvm.grid_constant" %arg)26// CHECK: define ptx_kernel void @_Z7tkernelIK1SEviT_(i32 noundef %dummy, ptr noundef byval(%struct.S) align 1 "nvvm.grid_constant" %arg)27 28