teak-llvm/clang/test/CodeGenCUDA/kernel-stub-name.cu
Yaxun Liu e739ac0e25 [HIP] change kernel stub name
Add .stub to kernel stub function name so that it is different from kernel
name in device code. This is necessary to let debugger find correct symbol
for kernel.

Differential Revision: https://reviews.llvm.org/D58518

llvm-svn: 354948
2019-02-27 02:02:52 +00:00

21 lines
664 B
Plaintext

// RUN: echo "GPU binary would be here" > %t
// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm %s \
// RUN: -fcuda-include-gpubinary %t -o - -x hip\
// RUN: | FileCheck -allow-deprecated-dag-overlap %s --check-prefixes=CHECK
#include "Inputs/cuda.h"
template<class T>
__global__ void kernelfunc() {}
// CHECK-LABEL: define{{.*}}@_Z8hostfuncv()
// CHECK: call void @[[STUB:_Z10kernelfuncIiEvv.stub]]()
void hostfunc(void) { kernelfunc<int><<<1, 1>>>(); }
// CHECK: define{{.*}}@[[STUB]]
// CHECK: call{{.*}}@hipLaunchByPtr{{.*}}@[[STUB]]
// CHECK-LABEL: define{{.*}}@__hip_register_globals
// CHECK: call{{.*}}@__hipRegisterFunction{{.*}}@[[STUB]]