1 // RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
3 // We expect to get a loop structure like this:
4 // do.body: ; preds = %do.cond, ...
7 // do.cond: ; preds = %do.body
9 // br i1 %cmp, label %do.body, label %do.end
10 // do.end: ; preds = %do.cond
13 // Verify that the loop metadata only is put on the backedge.
15 // CHECK-NOT: llvm.loop
16 // CHECK-LABEL: do.cond:
17 // CHECK: br {{.*}}, label %do.body, label %do.end, !llvm.loop ![[LMD1:[0-9]+]]
18 // CHECK-LABEL: do.end:
19 // CHECK-NOT: llvm.loop
20 // CHECK: ![[LMD1]] = distinct !{![[LMD1]], [[LMD2:![0-9]+]], ![[LMD3:[0-9]+]]}
21 // CHECK: [[LMD2]] = !{!"llvm.loop.mustprogress"}
22 // CHECK: ![[LMD3]] = !{!"llvm.loop.unroll.count", i32 4}
24 int test(int a
[], int n
) {