Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / optnone-pragma-optimize-off.cpp
blobd750c4c2848cb7eb1f174eee0a6d39ed5edf81ed
1 // RUN: %clang_cc1 %s -triple %itanium_abi_triple -O1 -disable-llvm-passes -emit-llvm -o - | FileCheck %s
3 // Test the attributes for the lambda function contains 'optnone' as result of
4 // the _Pragma("clang optimize off").
6 _Pragma("clang optimize off")
8 void foo(int p) {
9 auto lambda = [&p]() { ++p; };
10 lambda();
11 // CHECK: define {{.*}} @"_ZZ3fooiENK3$_0clEv"({{.*}}) #[[LAMBDA_ATR:[0-9]+]]
14 _Pragma("clang optimize on")
16 // CHECK: attributes #[[LAMBDA_ATR]] = { {{.*}} optnone {{.*}} }