brintos

brintos / llvm-project-archived public Read only

0
0
Text · 695 B · c784e60 Raw
26 lines · cpp
1// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -emit-llvm -O3 -fdeclspec \2// RUN:     -disable-llvm-passes -o - %s | FileCheck %s3 4int get_x();5 6struct A {7   __declspec(property(get = _get_x)) int x;8   static int _get_x(void) {9     return get_x();10   };11};12 13extern 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 ptr18// 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)22void test()23{24  int i = a.x;25}26