summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/cxx1z-decomposition.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2019-05-25 01:04:17 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2019-05-25 01:04:17 +0000
commit0353e5a6cdc8df518ab0cfebcc0b92747265a55e (patch)
tree152b6b7e940174a1b0e3b836c39f7200ab5d84cf /clang/test/CodeGenCXX/cxx1z-decomposition.cpp
parenta846427ad0ac94506661a65f9949c627011a73a4 (diff)
downloadbcm5719-llvm-0353e5a6cdc8df518ab0cfebcc0b92747265a55e.tar.gz
bcm5719-llvm-0353e5a6cdc8df518ab0cfebcc0b92747265a55e.zip
Permit static local structured bindings to be named from arbitrary scopes inside their declaring scope.
llvm-svn: 361686
Diffstat (limited to 'clang/test/CodeGenCXX/cxx1z-decomposition.cpp')
-rw-r--r--clang/test/CodeGenCXX/cxx1z-decomposition.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/clang/test/CodeGenCXX/cxx1z-decomposition.cpp b/clang/test/CodeGenCXX/cxx1z-decomposition.cpp
index 8e71b1230c4..31ade6f5fdb 100644
--- a/clang/test/CodeGenCXX/cxx1z-decomposition.cpp
+++ b/clang/test/CodeGenCXX/cxx1z-decomposition.cpp
@@ -129,7 +129,7 @@ void test_static_simple() {
}
// CHECK-LABEL: define {{.*}}@_Z17test_static_tuple
-void test_static_tuple() {
+int test_static_tuple() {
// Note that the desugaring specified for this construct requires three
// separate guarded initializations. It is possible for an exception to be
// thrown after the first initialization and before the second, and if that
@@ -162,4 +162,14 @@ void test_static_tuple() {
// CHECK: store {{.*}}, {{.*}} @_ZGRZ17test_static_tuplevE2x2_
// CHECK: store {{.*}} @_ZGRZ17test_static_tuplevE2x2_, {{.*}} @_ZZ17test_static_tuplevE2x2
// CHECK: call void @__cxa_guard_release({{.*}} @_ZGVZ17test_static_tuplevE2x2)
+
+ struct Inner {
+ // CHECK-LABEL: define {{.*}}@_ZZ17test_static_tuplevEN5Inner1fEv(
+ // FIXME: This first load should be constant-folded to the _ZGV... temporary.
+ // CHECK: load {{.*}} @_ZZ17test_static_tuplevE2x2
+ // CHECK: load
+ // CHECK: ret
+ int f() { return x2; }
+ };
+ return Inner().f();
}
OpenPOWER on IntegriCloud