33 lines · plain
1// RUN: %clang_cc1 -std=c++14 -ast-dump -x hip %s | FileCheck -check-prefixes=CHECK,HOST %s2// RUN: %clang_cc1 -std=c++14 -ast-dump -fcuda-is-device -x hip %s | FileCheck -check-prefixes=CHECK,DEV %s3 4#include "Inputs/cuda.h"5 6// CHECK-LABEL: VarDecl {{.*}} m1 'int'7// CHECK-NEXT: CUDAConstantAttr {{.*}}cuda.h8__constant__ int m1;9 10// CHECK-LABEL: VarDecl {{.*}} m2 'int'11// CHECK-NEXT: CUDAConstantAttr {{.*}}cuda.h12// CHECK-NOT: CUDAConstantAttr13__constant__ __constant__ int m2;14 15// CHECK-LABEL: VarDecl {{.*}} m3 'const int'16// HOST-NOT: CUDAConstantAttr17// DEV-NOT: CUDAConstantAttr {{.*}}cuda.h18// DEV: CUDAConstantAttr {{.*}}Implicit19// DEV-NOT: CUDAConstantAttr {{.*}}cuda.h20constexpr int m3 = 1;21 22// CHECK-LABEL: VarDecl {{.*}} m3a 'const int'23// CHECK-NOT: CUDAConstantAttr {{.*}}Implicit24// CHECK: CUDAConstantAttr {{.*}}cuda.h25// CHECK-NOT: CUDAConstantAttr {{.*}}Implicit26constexpr __constant__ int m3a = 2;27 28// CHECK-LABEL: VarDecl {{.*}} m3b 'const int'29// CHECK-NOT: CUDAConstantAttr {{.*}}Implicit30// CHECK: CUDAConstantAttr {{.*}}cuda.h31// CHECK-NOT: CUDAConstantAttr {{.*}}Implicit32__constant__ constexpr int m3b = 3;33