1 // RUN: %clang_cc1 -fsyntax-only -verify=host,com -x hip %s
2 // RUN: %clang_cc1 -fsyntax-only -fcuda-is-device -verify=dev,com -x hip %s
4 #include "Inputs/cuda.h"
7 __device__ int fun1(T x) {
8 // Check type-dependent constant is allowed in initializer.
9 static __device__ int a = sizeof(x);
10 static __device__ int b = x;
11 // com-error@-1 {{dynamic initialization is not supported for __device__, __constant__, __shared__, and __managed__ variables}}
15 __device__ int fun1_caller() {
17 // com-note@-1 {{in instantiation of function template specialization 'fun1<int>' requested here}}