lambda.cpp 544 B

1234567891011121314151617
  1. // RUN: %clang_cc1 -x c++ -std=c++11 -triple %itanium_abi_triple -fprofile-instr-generate -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only %s -main-file-name lambda.cpp | FileCheck %s
  2. // CHECK-LABEL: _Z3fooi:
  3. void foo(int i) { // CHECK: File 0, [[@LINE]]:17 -> {{[0-9]+}}:2 = #0
  4. auto f = [](int x) {
  5. return x + 1;
  6. };
  7. f(i);
  8. // Make sure the zero region after the return doesn't escape the lambda.
  9. // CHECK-NOT: File 0, {{[0-9:]+}} -> [[@LINE+1]]:2 = 0
  10. }
  11. int main(int argc, const char *argv[]) {
  12. foo(1);
  13. return 0;
  14. }