[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / CodeGenCXX / lambda-deterministic-captures.cpp
blobdb897c3aaf18fa2f1005aece918f34c6afb14f8e
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 %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 0
20 // CHECK-NEXT: getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 1
21 // CHECK-NEXT: store float 0.000
22 // CHECK-NEXT: getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 2
23 // CHECK-NEXT: store float 1.000
24 // CHECK-NEXT: getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 3
25 // CHECK-NEXT: store float 2.000
27 // The lambda body. Reverse iteration when the captures aren't deterministic
28 // causes these to be laid out differently in the lambda.
29 // CHECK: define internal void
30 // CHECK: getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 0
31 // CHECK: getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 1
32 // CHECK: getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 2
33 // CHECK: getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 3