[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / CodeGenCXX / for-loop-init-ternary-operator-statement.cpp
bloba40898b0e84d1b4f34ddd54719f19ce5c6f26066
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm %s -o - | FileCheck %s
4 // CHECK-LABEL: @_Z1fv(
5 // CHECK-NEXT: entry:
6 // CHECK-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
7 // CHECK-NEXT: [[I:%.*]] = alloca i32, align 4
8 // CHECK-NEXT: [[X:%.*]] = alloca i32, align 4
9 // CHECK-NEXT: store i32 0, i32* [[I]], align 4
10 // CHECK-NEXT: br label [[FOR_COND:%.*]]
11 // CHECK: for.cond:
12 // CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[I]], align 4
13 // CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[TMP0]], 2
14 // CHECK-NEXT: [[TMP1:%.*]] = zext i1 [[CMP]] to i64
15 // CHECK-NEXT: [[COND:%.*]] = select i1 [[CMP]], i32 1, i32 0
16 // CHECK-NEXT: store i32 [[COND]], i32* [[X]], align 4
17 // CHECK-NEXT: [[TMP2:%.*]] = load i32, i32* [[X]], align 4
18 // CHECK-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP2]], 0
19 // CHECK-NEXT: br i1 [[TOBOOL]], label [[FOR_BODY:%.*]], label [[FOR_END:%.*]]
20 // CHECK: for.body:
21 // CHECK-NEXT: [[TMP3:%.*]] = load i32, i32* [[X]], align 4
22 // CHECK-NEXT: store i32 [[TMP3]], i32* [[RETVAL]], align 4
23 // CHECK-NEXT: br label [[RETURN:%.*]]
24 // CHECK: for.inc:
25 // CHECK-NEXT: [[TMP4:%.*]] = load i32, i32* [[I]], align 4
26 // CHECK-NEXT: [[INC:%.*]] = add nsw i32 [[TMP4]], 1
27 // CHECK-NEXT: store i32 [[INC]], i32* [[I]], align 4
28 // CHECK-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP2:![0-9]+]]
29 // CHECK: for.end:
30 // CHECK-NEXT: store i32 0, i32* [[RETVAL]], align 4
31 // CHECK-NEXT: br label [[RETURN]]
32 // CHECK: return:
33 // CHECK-NEXT: [[TMP5:%.*]] = load i32, i32* [[RETVAL]], align 4
34 // CHECK-NEXT: ret i32 [[TMP5]]
36 int f() {
37 for (int i = 0; int x = i < 2 ? 1 : 0; i++) {
38 return x;
40 return 0;