1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 2
2 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm %s -o - | FileCheck %s
4 // Test for PR62830 where there are 2 infinite cycles using goto. Make sure
5 // clang codegen doesn't hang.
8 // CHECK-LABEL: define dso_local i32 @main
9 // CHECK-SAME: () #[[ATTR0:[0-9]+]] {
11 // CHECK-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
12 // CHECK-NEXT: store i32 0, ptr [[RETVAL]], align 4
13 // CHECK-NEXT: br label [[L1:%.*]]
15 // CHECK-NEXT: br label [[L1]]
17 // CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr @a, align 4
18 // CHECK-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0
19 // CHECK-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
21 // CHECK-NEXT: br label [[L2:%.*]]
23 // CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[RETVAL]], align 4
24 // CHECK-NEXT: ret i32 [[TMP1]]