[RISCV] Simplify usage of SplatPat_simm5_plus1. NFC (#125340)
[llvm-project.git] / clang / test / CodeGenCXX / lambda-deterministic-captures.cpp
blobab44f43720832bfa3ac7573e963925c7d270e1a1
1 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm --std=c++17 %s -o - | FileCheck %s
3 struct stream {
4 friend const stream &operator<<(const stream &, const float &);
5 };
7 void foo() {
8 constexpr float f_zero = 0.0f;
9 constexpr float f_one = 1.0f;
10 constexpr float f_two = 2.0f;
12 stream s;
13 [=]() {
14 s << f_zero << f_one << f_two;
15 }();
18 // CHECK: define{{.*}} void @_Z3foov
19 // CHECK: getelementptr inbounds nuw %{{.+}}, ptr %{{.+}}, i32 0, i32 1
20 // CHECK-NEXT: store float 0.000
21 // CHECK-NEXT: getelementptr inbounds nuw %{{.+}}, ptr %{{.+}}, i32 0, i32 2
22 // CHECK-NEXT: store float 1.000
23 // CHECK-NEXT: getelementptr inbounds nuw %{{.+}}, ptr %{{.+}}, i32 0, i32 3
24 // CHECK-NEXT: store float 2.000
26 // The lambda body. Reverse iteration when the captures aren't deterministic
27 // causes these to be laid out differently in the lambda.
28 // CHECK: define internal void
29 // CHECK: getelementptr inbounds nuw %{{.+}}, ptr %{{.+}}, i32 0, i32 1
30 // CHECK: getelementptr inbounds nuw %{{.+}}, ptr %{{.+}}, i32 0, i32 2
31 // CHECK: getelementptr inbounds nuw %{{.+}}, ptr %{{.+}}, i32 0, i32 3