diff options
Diffstat (limited to 'clang/test/AST/ByteCode/codegen-cxx20.cpp')
| -rw-r--r-- | clang/test/AST/ByteCode/codegen-cxx20.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/AST/ByteCode/codegen-cxx20.cpp b/clang/test/AST/ByteCode/codegen-cxx20.cpp new file mode 100644 index 0000000..c1ef629 --- /dev/null +++ b/clang/test/AST/ByteCode/codegen-cxx20.cpp @@ -0,0 +1,15 @@ +// RUN: %clang_cc1 -triple x86_64-linux -emit-llvm -o - %s -fcxx-exceptions | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-linux -emit-llvm -o - %s -fcxx-exceptions -fexperimental-new-constant-interpreter | FileCheck %s + + +/// The read from a used to succeed, causing the entire if statement to vanish. +extern void e(); +int somefunc() { + auto foo = [a = false]() mutable { + if (a) + e(); + }; + foo(); +} + +// CHECK: call void @_Z1ev() |
