1*532dc62bSNikita Popov // RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-unknown-linux-gnu -emit-llvm --std=c++17 %s -o - | FileCheck %s
21eddce41SErich Keane 
31eddce41SErich Keane struct stream {
41eddce41SErich Keane   friend const stream &operator<<(const stream &, const float &);
51eddce41SErich Keane };
61eddce41SErich Keane 
foo()71eddce41SErich Keane void foo() {
81eddce41SErich Keane   constexpr float f_zero = 0.0f;
91eddce41SErich Keane   constexpr float f_one = 1.0f;
101eddce41SErich Keane   constexpr float f_two = 2.0f;
111eddce41SErich Keane 
121eddce41SErich Keane   stream s;
131eddce41SErich Keane   [=]() {
141eddce41SErich Keane     s << f_zero << f_one << f_two;
151eddce41SErich Keane   }();
161eddce41SErich Keane }
171eddce41SErich Keane 
18fd739804SFangrui Song // CHECK: define{{.*}} void @_Z3foov
191eddce41SErich Keane // CHECK: getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 0
201eddce41SErich Keane // CHECK-NEXT: getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 1
211eddce41SErich Keane // CHECK-NEXT: store float 0.000
221eddce41SErich Keane // CHECK-NEXT: getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 2
231eddce41SErich Keane // CHECK-NEXT: store float 1.000
241eddce41SErich Keane // CHECK-NEXT: getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 3
251eddce41SErich Keane // CHECK-NEXT: store float 2.000
261eddce41SErich Keane 
271eddce41SErich Keane // The lambda body.  Reverse iteration when the captures aren't deterministic
281eddce41SErich Keane // causes these to be laid out differently in the lambda.
291eddce41SErich Keane // CHECK: define internal void
301eddce41SErich Keane // CHECK: getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 0
311eddce41SErich Keane // CHECK: getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 1
321eddce41SErich Keane // CHECK: getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 2
331eddce41SErich Keane // CHECK: getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 3
34