1; RUN: opt %loadPolly -polly-detect -analyze < %s | \
2; RUN:     FileCheck %s -check-prefix=DETECT
3
4; RUN: opt %loadPolly -polly-scops -analyze < %s | \
5; RUN:     FileCheck %s -check-prefix=SCOP
6
7; DETECT: Valid Region for Scop: loop => barrier
8; DETECT-NEXT: Valid Region for Scop: branch => end
9
10; SCOP: Statements {
11; SCOP-NEXT: 	Stmt_then
12; SCOP-NEXT:         Domain :=
13; SCOP-NEXT:             [p_0] -> { Stmt_then[] : p_0 <= -2 or p_0 >= 0 };
14; SCOP-NEXT:         Schedule :=
15; SCOP-NEXT:             [p_0] -> { Stmt_then[] -> [] };
16; SCOP-NEXT:         MustWriteAccess :=	[Reduction Type: NONE] [Scalar: 0]
17; SCOP-NEXT:             [p_0] -> { Stmt_then[] -> MemRef_A[0] };
18; SCOP-NEXT: }
19
20target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
21target triple = "aarch64--linux-android"
22
23define void @f(i16 %event, float* %A) {
24entry:
25  br label %loop
26
27loop:
28  %indvar = phi i8 [ 0, %entry ], [ %indvar.next, %loop ]
29  %indvar.next = add i8 %indvar, -1
30  store float 1.0, float* %A
31  %cmp = icmp eq i8 %indvar.next, 0
32  br i1 false, label %barrier, label %loop
33
34barrier:
35  fence seq_cst
36  br label %branch
37
38branch:
39  br i1 %cmp, label %branch, label %then
40
41then:
42  store float 1.0, float* %A
43  br label %end
44
45end:
46  ret void
47}
48