xref: /llvm-project/clang/test/Modules/pr72828.cppm (revision 7c1d9b15eee3a34678addab2bab66f3020ac0753)
1// Test that we can handle capturing structured bindings.
2//
3// RUN: rm -fr %t
4// RUN: mkdir %t
5//
6// RUN: %clang_cc1 -std=c++23 -triple %itanium_abi_triple \
7// RUN:     %s -emit-module-interface -o %t/m.pcm
8// RUN: %clang_cc1 -std=c++23 -triple %itanium_abi_triple \
9// RUN:     -emit-llvm -disable-llvm-passes %t/m.pcm \
10// RUN:     -o - | FileCheck %s
11
12export module m;
13
14struct s {
15	int m;
16};
17
18void f() {
19	auto [x] = s();
20	(void) [x] {};
21}
22
23// Check that we can generate the LLVM IR expectedly.
24// CHECK: define{{.*}}@_ZGIW1m
25