YouCompleteMe/cpp/llvm/tools/clang/test/CodeGen/block-byref-aggr.c
Strahinja Val Markovic 1f51a89d39 Adding more llvm/clang files
These were ignored by git accidentally. We want ALL OF THEM since they all came
in the llvm/clang source distribution.
2012-07-05 17:55:45 -07:00

18 lines
534 B
C

// RUN: %clang_cc1 %s -emit-llvm -o - -fblocks -triple x86_64-apple-darwin10 | FileCheck %s
// rdar://9309454
typedef struct { int v; } RetType;
RetType func();
int main () {
__attribute__((__blocks__(byref))) RetType a = {100};
a = func();
}
// CHECK: [[C1:%.*]] = call i32 (...)* @func()
// CHECK-NEXT: [[CO:%.*]] = getelementptr
// CHECK-NEXT: store i32 [[C1]], i32* [[CO]]
// CHECK-NEXT: [[FORWARDING:%.*]] = getelementptr inbounds [[BR:%.*]]* [[A:%.*]], i32 0, i32 1
// CHECK-NEXT: [[O:%.*]] = load [[BR]]** [[FORWARDING]]