brintos

brintos / llvm-project-archived public Read only

0
0
Text · 717 B · 8e4cd72 Raw
30 lines · plain
1// RUN: %clang_cc1 -std=c++11 -fblocks -emit-llvm -o - -triple x86_64-apple-darwin11.3 %s | FileCheck %s2 3namespace PR12746 {4  // CHECK: define{{.*}} zeroext i1 @_ZN7PR127462f1EPi5  bool f1(int *x) {6    // CHECK: store ptr @___ZN7PR127462f1EPi_block_invoke7    bool (^outer)() = ^ {8      auto inner = [&]() -> bool {9	return x == 0;10      };11      return inner();12    };13    return outer();14  }15 16  // CHECK: define internal noundef zeroext i1 @___ZN7PR127462f1EPi_block_invoke17  // CHECK: call noundef zeroext i1 @"_ZZZN7PR127462f1EPiEUb_ENK3$_0clEv"18 19  bool f2(int *x) {20    auto outer = [&]() -> bool {21      bool (^inner)() = ^ {22	return x == 0;23      };24      return inner();25    };26    return outer();27  }28}29 30