hyeongyu kim 1b1c8d83d3 [Clang/Test]: Rename enable_noundef_analysis to disable-noundef-analysis and turn it off by default
Turning on `enable_noundef_analysis` flag allows better codegen by removing freeze instructions.
I modified clang by renaming `enable_noundef_analysis` flag to `disable-noundef-analysis` and turning it off by default.

Test updates are made as a separate patch: D108453

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D105169
2022-01-16 18:54:17 +09:00

30 lines
744 B
Plaintext

// RUN: %clang_cc1 -std=c++11 -fblocks -emit-llvm -o - -triple x86_64-apple-darwin11.3 %s | FileCheck %s
namespace PR12746 {
// CHECK: define{{.*}} zeroext i1 @_ZN7PR127462f1EPi
bool f1(int *x) {
// CHECK: store i8* bitcast (i1 (i8*)* @___ZN7PR127462f1EPi_block_invoke to i8*)
bool (^outer)() = ^ {
auto inner = [&]() -> bool {
return x == 0;
};
return inner();
};
return outer();
}
// CHECK: define internal noundef zeroext i1 @___ZN7PR127462f1EPi_block_invoke
// CHECK: call noundef zeroext i1 @"_ZZZN7PR127462f1EPiEUb_ENK3$_0clEv"
bool f2(int *x) {
auto outer = [&]() -> bool {
bool (^inner)() = ^ {
return x == 0;
};
return inner();
};
return outer();
}
}