1 ; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-print-scops -debug -disable-output < %s 2>&1 | FileCheck %s
5 ; This test case at some point crashed Polly due to a 'division by zero'
6 ; when trying to fold the constant dimension into outer dimension.
7 ; We verify that this scop is detected without crash. We also test the
8 ; output to understand that the scop has been analyzed, but has also been
9 ; invalidated due to the zero size dimension.
11 ; CHECK: Assumed Context:
12 ; CHECK-NEXT: { : false }
13 ; CHECK-NEXT: Invalid Context:
14 ; CHECK-NEXT: { : false }
16 ; CHECK-NEXT: i8 MemRef_arg[*][0]; // Element size 1
18 ; CHECK-NEXT: Arrays (Bounds as pw_affs) {
19 ; CHECK-NEXT: i8 MemRef_arg[*][ { [] -> [(0)] } ]; // Element size 1
21 ; CHECK-NEXT: Alias Groups (0):
23 ; CHECK-NEXT: Statements {
24 ; CHECK-NEXT: Stmt_bb2
25 ; CHECK-NEXT: Domain :=
26 ; CHECK-NEXT: { Stmt_bb2[] };
27 ; CHECK-NEXT: Schedule :=
28 ; CHECK-NEXT: { Stmt_bb2[] -> [] };
29 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
30 ; CHECK-NEXT: { Stmt_bb2[] -> MemRef_arg[0, 0] };
31 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
32 ; CHECK-NEXT: { Stmt_bb2[] -> MemRef_arg[o0, o1] : false };
35 target datalayout = "e-p:64:64:64-S128-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f16:16:16-f32:32:32-f64:64:64-f128:128:128-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
37 declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i32, i1) #0
39 define void @hoge([0 x [0 x i8]]* noalias %arg) {
43 bb1: ; preds = %bb5, %bb
44 br i1 false, label %bb5, label %bb2
47 %tmp = getelementptr [0 x [0 x i8]], [0 x [0 x i8]]* %arg, i64 0, i64 0, i64 0
48 store i8 32, i8* %tmp, align 1
49 %tmp3 = getelementptr [0 x [0 x i8]], [0 x [0 x i8]]* %arg, i64 0, i64 0, i64 0
50 %tmp4 = getelementptr i8, i8* %tmp3, i64 1
51 tail call void @llvm.memset.p0i8.i64(i8* %tmp4, i8 32, i64 0, i32 1, i1 false)
54 bb5: ; preds = %bb2, %bb1
55 br i1 undef, label %bb6, label %bb1