Files
clang-p2996/clang/test/CodeGenCUDA/debug-info-template.cu
Michael Liao 982cbb6232 [CUDA][HIP][DebugInfo] Skip reference device function
Summary:
- A device functions could be used as a non-type template parameter in a
  global/host function template. However, we should not try to retrieve that
  device function and reference it in the host-side debug info as it's
  only valid at device side.

Subscribers: aprantl, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 355551
2019-03-06 21:16:27 +00:00

11 lines
452 B
Plaintext

// RUN: %clang_cc1 %s --std=c++11 -triple x86_64-unknown-linux -emit-llvm -o - -debug-info-kind=limited -dwarf-version=2 -debugger-tuning=gdb | FileCheck %s
#include "Inputs/cuda.h"
__device__ void f();
template<void(*F)()> __global__ void t() { F(); }
__host__ void g() { t<f><<<1,1>>>(); }
// Ensure the value of device-function (as value template parameter) is null.
// CHECK: !DITemplateValueParameter(name: "F", type: !{{[0-9]+}}, value: null)