[RISCV] Simplify usage of SplatPat_simm5_plus1. NFC (#125340)
[llvm-project.git] / clang / test / CodeGenCUDA / template-class-static-member.cu
blobb614cd9dcbb14d0fdc8e6ce47a71f437fae02723
1 // RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -fcuda-is-device \
2 // RUN:   -emit-llvm -o - -x hip %s | FileCheck -check-prefix=DEV %s
4 // RUN: %clang_cc1 -triple x86_64-gnu-linux -std=c++11 \
5 // RUN:   -emit-llvm -o - -x hip %s | FileCheck -check-prefix=HOST %s
7 // Negative tests.
9 // RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -fcuda-is-device \
10 // RUN:   -emit-llvm -o - -x hip %s | FileCheck -check-prefix=DEV-NEG %s
12 #include "Inputs/cuda.h"
14 template <class T>
15 class A {
16     static int h_member;
17     __device__ static int d_member;
18     __constant__ static int c_member;
19     __managed__ static int m_member;
20     const static int const_member = 0;
23 template <class T>
24 int A<T>::h_member;
26 template <class T>
27 __device__ int A<T>::d_member;
29 template <class T>
30 __constant__ int A<T>::c_member;
32 template <class T>
33 __managed__ int A<T>::m_member;
35 template <class T>
36 const int A<T>::const_member;
38 template class A<int>;
40 //DEV-DAG: @_ZN1AIiE8d_memberE = internal addrspace(1) global i32 0, comdat, align 4
41 //DEV-DAG: @_ZN1AIiE8c_memberE = internal addrspace(4) constant i32 0, comdat, align 4
42 //DEV-DAG: @_ZN1AIiE8m_memberE = internal addrspace(1) externally_initialized global ptr addrspace(1) null
43 //DEV-DAG: @_ZN1AIiE12const_memberE = internal addrspace(4) constant i32 0, comdat, align 4
44 //DEV-NEG-NOT: @_ZN1AIiE8h_memberE
46 //HOST-DAG: @_ZN1AIiE8h_memberE = weak_odr global i32 0, comdat, align 4
47 //HOST-DAG: @_ZN1AIiE8d_memberE = internal global i32 undef, comdat, align 4
48 //HOST-DAG: @_ZN1AIiE8c_memberE = internal global i32 undef, comdat, align 4
49 //HOST-DAG: @_ZN1AIiE8m_memberE = internal externally_initialized global ptr null
50 //HOST-DAG: @_ZN1AIiE12const_memberE = weak_odr constant i32 0, comdat, align 4