; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 5 ; RUN: opt < %s -disable-output "-passes=print" 2>&1 | FileCheck %s ; Test case for SmallBitVector bounds checking bug in DependenceAnalysis. ; This test ensures that loop index mapping functions don't cause out-of-bounds ; access to SmallBitVector when loop depths exceed MaxLevels. define void @bounds_check_test(ptr %a) { ; CHECK-LABEL: 'bounds_check_test' ; CHECK-NEXT: Src: store i8 0, ptr %idx, align 1 --> Dst: store i8 0, ptr %idx, align 1 ; CHECK-NEXT: da analyze - output [*]! ; entry: br label %loop loop: %i = phi i64 [ 0, %entry ], [ %i.next, %loop ] %and = and i64 %i, 1 ; Creates index 0 or 1 %idx = getelementptr inbounds [4 x [4 x i8]], ptr %a, i64 0, i64 %and, i64 %i store i8 0, ptr %idx %i.next = add i64 %i, 1 %exitcond.not = icmp slt i64 %i.next, 4 br i1 %exitcond.not, label %loop, label %exit exit: ret void }