brintos

brintos / llvm-project-archived public Read only

0
0
Text · 873 B · 9676d21 Raw
26 lines · plain
1// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fblocks -fobjc-arc -emit-llvm -o - %s | FileCheck %s2 3// CHECK: %[[STRUCT_A:.*]] = type { ptr }4 5typedef struct {6  id f;7} A;8 9id a;10 11// Check that the compound literal is destructed at the end of the enclosing scope.12 13// CHECK-LABEL: define void @foo0()14// CHECK: %[[_COMPOUNDLITERAL:.*]] = alloca %[[STRUCT_A]], align 815// CHECK: getelementptr inbounds nuw %[[STRUCT_A]], ptr %[[_COMPOUNDLITERAL]], i32 0, i32 016// CHECK: %[[F1:.*]] = getelementptr inbounds nuw %[[STRUCT_A]], ptr %[[_COMPOUNDLITERAL]], i32 0, i32 017// CHECK: %[[V2:.*]] = load ptr, ptr %[[F1]], align 818// CHECK: call void asm sideeffect "", "r,~{dirflag},~{fpsr},~{flags}"(ptr %[[V2]])19// CHECK: call void asm sideeffect "",20// CHECK: call void @__destructor_8_s0(ptr %[[_COMPOUNDLITERAL]])21 22void foo0() {23  asm("" : : "r"(((A){a}).f) );24  asm("");25}26