1 ; RUN: opt %loadPolly -polly-detect -analyze < %s | FileCheck %s
2 ; RUN: opt %loadPolly -polly-scops -analyze < %s
4 ; CHECK: Valid Region for Scop: bb10 => bb16
6 ; Verify that -polly-scops does not crash. At some point this piece of
7 ; code crashed as we extracted from the SCEV expression:
9 ; ((8 * ((%a * %b) + %c)) + (-8 * %a))'
11 ; the constant 8, which resulted in the new expression:
13 ; (((-1 + %b) * %a) + %c)
15 ; which introduced a new parameter (-1 + %b) * %a which was not registered
16 ; correctly and consequently caused a crash due to an expression not being
17 ; regiustered as a parameter.
19 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
21 define void @barney(i32* %arg, i32* %arg1, double* %arg2, i32* %arg3, i32 %a, i32 %b, i32 %c) {
26 br i1 true, label %bb11, label %bb16
29 %tmp4 = add nsw i32 1, %a
30 %tmp5 = sub i32 0, %tmp4
31 %tmp8 = add nsw i32 %c, 1
32 %tmp12 = mul nsw i32 %b, %a
33 %tmp13 = add nsw i32 %tmp8, %tmp12
34 %tmp6 = getelementptr inbounds double, double* %arg2, i32 %tmp5
35 %tmp14 = getelementptr inbounds double, double* %tmp6, i32 %tmp13
36 %tmp15 = load double, double* %tmp14
39 bb16: ; preds = %bb11, %bb10