Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / amdgcn_declspec_get.cpp
blob0ce88014eafd248dc4d9d7fc0ccc97f001666ca3
1 // RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -emit-llvm -O3 -fdeclspec \
2 // RUN: -disable-llvm-passes -o - %s | FileCheck %s
4 int get_x();
6 struct A {
7 __declspec(property(get = _get_x)) int x;
8 static int _get_x(void) {
9 return get_x();
13 extern const A a;
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(i64 4, 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(i64 4, ptr addrspace(5) %i)
22 void test()
24 int i = a.x;