// RUN: %amp_device -D__KALMAR_ACCELERATOR__ -c -S -emit-llvm %s -o -|%cppfilt|%FileCheck %s
#include "hc.hpp"
class baz {
 public:
  void operator()(hc::index<1> &idx) [[hc]] {
  }
#if 0
  // The declaration and body of this function will be generated
  static __attribute__((annotate("__cxxamp_trampoline")))
  void __cxxamp_trampoline(int foo, float bar) [[hc]];
#endif
 private:
  int foo;
  float bar;
};
template<typename Foo>
void kerker(void) [[hc]] {
  // This reference triggers declaration&definition of __cxxamp_trampoline
  int* b = reinterpret_cast<int*>(&Foo::__cxxamp_trampoline);
}
void kk(void) [[hc]] {
  kerker<baz>();
}
// The definition should be generated by clang
// CHECK: define {{.*}}void @baz::__cxxamp_trampoline
