• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: %clang_cc1 -emit-llvm -o - -fblocks %s -O1 -triple x86_64-apple-darwin10.0.0 -fobjc-runtime=macosx-fragile-10.5 | FileCheck %s
2
3// PR10835 / <rdar://problem/10050178>
4struct X {
5  X();
6  X(const X&);
7  ~X();
8};
9
10@interface NRVO
11@end
12
13@implementation NRVO
14// CHECK: define internal void @"\01-[NRVO getNRVO]"
15- (X)getNRVO {
16  X x;
17  // CHECK: tail call void @_ZN1XC1Ev
18  // CHECK-NEXT: ret void
19  return x;
20}
21@end
22
23X blocksNRVO() {
24  return ^{
25    // CHECK-LABEL: define internal void @___Z10blocksNRVOv_block_invoke
26    X x;
27    // CHECK: tail call void @_ZN1XC1Ev
28    // CHECK-NEXT: ret void
29    return x;
30  }() ;
31}
32
33