1 // RUN: %clang_cc1 -isystem %S/Inputs -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -isystem %S/Inputs -fcuda-is-device -fsyntax-only -verify %s
6 // Check trivial ctor/dtor
15 // Check trivial ctor/dtor of template class
23 __device__ TA<int> ta;
25 // Check non-trivial ctor/dtor in parent template class
29 TB() { static int nontrivial_ctor = 1; }
40 template class TC<int>;
42 __device__ TC<int> tc; //expected-error {{dynamic initialization is not supported for __device__, __constant__, __shared__, and __managed__ variables}}
44 // Check trivial ctor specialization
50 template <> C<int>::C() {};
51 __device__ C<int> ci_d;
54 // Check non-trivial ctor specialization
55 template <> C<float>::C() { static int nontrivial_ctor = 1; }
56 __device__ C<float> cf_d; //expected-error {{dynamic initialization is not supported for __device__, __constant__, __shared__, and __managed__ variables}}