| 1 |
// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -emit-llvm -O3 -fdeclspec \ |
| 2 |
// RUN: -disable-llvm-passes -o - %s | FileCheck %s |
| 3 |
|
| 4 |
int get_x(); |
| 5 |
|
| 6 |
struct A { |
| 7 |
__declspec(property(get = _get_x)) int x; |
| 8 |
static int _get_x(void) { |
| 9 |
return get_x(); |
| 10 |
}; |
| 11 |
}; |
| 12 |
|
| 13 |
extern const A a; |
| 14 |
|
| 15 |
// CHECK-LABEL: define{{.*}} void @_Z4testv() |
| 16 |
// CHECK: %i = alloca i32, align 4, addrspace(5) |
| 17 |
// CHECK: %[[ii:.*]] = addrspacecast ptr addrspace(5) %i to ptr |
| 18 |
// CHECK: call void @llvm.lifetime.start.p5(ptr addrspace(5) %i) |
| 19 |
// CHECK: %call = call noundef i32 @_ZN1A6_get_xEv() |
| 20 |
// CHECK: store i32 %call, ptr %[[ii]] |
| 21 |
// CHECK: call void @llvm.lifetime.end.p5(ptr addrspace(5) %i) |
| 22 |
void test() |
| 23 |
{ |
| 24 |
int i = a.x; |
| 25 |
} |