comparison clang/test/CodeGenCUDA/device-use-host-var.cu @ 252:1f2b6ac9f198 llvm-original

LLVM16-1
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Fri, 18 Aug 2023 09:04:13 +0900
parents c4bab56944e8
children
comparison
equal deleted inserted replaced
237:c80f45b162ad 252:1f2b6ac9f198
1 // RUN: %clang_cc1 -no-opaque-pointers -std=c++14 -triple amdgcn-amd-amdhsa \ 1 // RUN: %clang_cc1 -std=c++14 -triple amdgcn-amd-amdhsa \
2 // RUN: -fcuda-is-device -emit-llvm -o - -x hip %s | FileCheck %s 2 // RUN: -fcuda-is-device -emit-llvm -o - -x hip %s | FileCheck %s
3 // RUN: %clang_cc1 -no-opaque-pointers -std=c++14 -triple amdgcn-amd-amdhsa \ 3 // RUN: %clang_cc1 -std=c++14 -triple amdgcn-amd-amdhsa \
4 // RUN: -fcuda-is-device -emit-llvm -o - -x hip %s | FileCheck -check-prefix=NEG %s 4 // RUN: -fcuda-is-device -emit-llvm -o - -x hip %s | FileCheck -check-prefix=NEG %s
5 5
6 #include "Inputs/cuda.h" 6 #include "Inputs/cuda.h"
7 7
8 struct A { 8 struct A {
69 69
70 // CHECK-LABEL: define{{.*}}@_Z7dev_funPiPPKi 70 // CHECK-LABEL: define{{.*}}@_Z7dev_funPiPPKi
71 // CHECK: store i32 1 71 // CHECK: store i32 1
72 // CHECK: store i32 2 72 // CHECK: store i32 2
73 // CHECK: store i32 3 73 // CHECK: store i32 3
74 // CHECK: load i8, i8* getelementptr {{.*}} @_ZL13constexpr_str.const 74 // CHECK: load i8, ptr getelementptr {{.*}} @_ZL13constexpr_str.const
75 // CHECK: store i32 4 75 // CHECK: store i32 4
76 // CHECK: store i32 5 76 // CHECK: store i32 5
77 // CHECK: store i32 6 77 // CHECK: store i32 6
78 // CHECK: load i8, i8* getelementptr {{.*}} @_ZL9const_str 78 // CHECK: load i8, ptr getelementptr {{.*}} @_ZL9const_str
79 // CHECK: store i32* {{.*}}@_ZL13constexpr_var 79 // CHECK: store ptr {{.*}}@_ZL13constexpr_var
80 // CHECK: store i32* getelementptr {{.*}} @_ZL16constexpr_struct 80 // CHECK: store ptr {{.*}} @_ZL16constexpr_struct
81 // CHECK: store i32* getelementptr {{.*}} @_ZL15constexpr_array 81 // CHECK: store ptr getelementptr {{.*}} @_ZL15constexpr_array
82 // CHECK: store i32* {{.*}}@_ZL9const_var 82 // CHECK: store ptr {{.*}}@_ZL9const_var
83 // CHECK: store i32* getelementptr {{.*}} @_ZL12const_struct 83 // CHECK: store ptr {{.*}} @_ZL12const_struct
84 // CHECK: store i32* getelementptr {{.*}} @_ZL11const_array 84 // CHECK: store ptr getelementptr {{.*}} @_ZL11const_array
85 __device__ void dev_fun(int *out, const int **out2) { 85 __device__ void dev_fun(int *out, const int **out2) {
86 *out = constexpr_var; 86 *out = constexpr_var;
87 *out = constexpr_struct.x; 87 *out = constexpr_struct.x;
88 *out = constexpr_array[3].x; 88 *out = constexpr_array[3].x;
89 *out = constexpr_str[3]; 89 *out = constexpr_str[3];