blob: d750c4c2848cb7eb1f174eee0a6d39ed5edf81ed [file] [log] [blame]
Carlos Alberto Enciso01ae6f22018-03-26 13:48:03 +00001// RUN: %clang_cc1 %s -triple %itanium_abi_triple -O1 -disable-llvm-passes -emit-llvm -o - | FileCheck %s
2
3// Test the attributes for the lambda function contains 'optnone' as result of
4// the _Pragma("clang optimize off").
5
6_Pragma("clang optimize off")
7
8void foo(int p) {
9 auto lambda = [&p]() { ++p; };
10 lambda();
11 // CHECK: define {{.*}} @"_ZZ3fooiENK3$_0clEv"({{.*}}) #[[LAMBDA_ATR:[0-9]+]]
12}
13
14_Pragma("clang optimize on")
15
16// CHECK: attributes #[[LAMBDA_ATR]] = { {{.*}} optnone {{.*}} }