1; RUN: opt %loadPolly -polly-scops  -analyze -polly-only-func=f.*,g.* < %s | FileCheck %s
2;
3; Check that the flag `-polly-only-func` works with regexes.
4;
5; CHECK:      Function: f1
6; CHECK-NEXT:    Region: %for.cond---%for.end
7;
8; CHECK:      Function: f2
9; CHECK-NEXT:    Region: %for.cond---%for.end
10;
11; CHECK:      Function: g1
12; CHECK-NEXT:    Region: %for.cond---%for.end
13;
14; CHECK-NOT:      Function: h
15;
16; void f1(int* sum) {
17;   for (int i = 0; i <= 100; i++)
18;     sum += i * 3;
19; }
20; void f2(int* sum) {
21;   for (int i = 0; i <= 100; i++)
22;     sum += i * 3;
23; }
24; void g1(int* sum) {
25;   for (int i = 0; i <= 100; i++)
26;     sum += i * 3;
27; }
28; void h(int* sum) {
29;   for (int i = 0; i <= 100; i++)
30;     sum += i * 3;
31; }
32target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
33
34define void @f1(i32* %sum) {
35entry:
36  br label %entry.split1
37
38entry.split1:                                     ; preds = %entry
39  br label %entry.split
40
41entry.split:                                      ; preds = %entry.split1
42  br label %for.cond
43
44for.cond:                                         ; preds = %for.cond, %entry.split
45  %i1.0 = phi i32 [ 0, %entry.split ], [ %inc, %for.cond ]
46  %sum.reload = load i32, i32* %sum
47  %mul = mul nsw i32 %i1.0, 3
48  %add = add nsw i32 %sum.reload, %mul
49  %inc = add nsw i32 %i1.0, 1
50  store i32 %add, i32* %sum
51  %cmp = icmp slt i32 %i1.0, 100
52  br i1 %cmp, label %for.cond, label %for.end
53
54for.end:                                          ; preds = %for.cond
55  ret void
56}
57
58
59define void @f2(i32* %sum) {
60entry:
61  br label %entry.split1
62
63entry.split1:                                     ; preds = %entry
64  br label %entry.split
65
66entry.split:                                      ; preds = %entry.split1
67  br label %for.cond
68
69for.cond:                                         ; preds = %for.cond, %entry.split
70  %i1.0 = phi i32 [ 0, %entry.split ], [ %inc, %for.cond ]
71  %sum.reload = load i32, i32* %sum
72  %mul = mul nsw i32 %i1.0, 3
73  %add = add nsw i32 %sum.reload, %mul
74  %inc = add nsw i32 %i1.0, 1
75  store i32 %add, i32* %sum
76  %cmp = icmp slt i32 %i1.0, 100
77  br i1 %cmp, label %for.cond, label %for.end
78
79for.end:                                          ; preds = %for.cond
80  ret void
81}
82
83define void @g1(i32* %sum) {
84entry:
85  br label %entry.split1
86
87entry.split1:                                     ; preds = %entry
88  br label %entry.split
89
90entry.split:                                      ; preds = %entry.split1
91  br label %for.cond
92
93for.cond:                                         ; preds = %for.cond, %entry.split
94  %i1.0 = phi i32 [ 0, %entry.split ], [ %inc, %for.cond ]
95  %sum.reload = load i32, i32* %sum
96  %mul = mul nsw i32 %i1.0, 3
97  %add = add nsw i32 %sum.reload, %mul
98  %inc = add nsw i32 %i1.0, 1
99  store i32 %add, i32* %sum
100  %cmp = icmp slt i32 %i1.0, 100
101  br i1 %cmp, label %for.cond, label %for.end
102
103for.end:                                          ; preds = %for.cond
104  ret void
105}
106
107define void @h(i32* %sum) {
108entry:
109  br label %entry.split1
110
111entry.split1:                                     ; preds = %entry
112  br label %entry.split
113
114entry.split:                                      ; preds = %entry.split1
115  br label %for.cond
116
117for.cond:                                         ; preds = %for.cond, %entry.split
118  %i1.0 = phi i32 [ 0, %entry.split ], [ %inc, %for.cond ]
119  %sum.reload = load i32, i32* %sum
120  %mul = mul nsw i32 %i1.0, 3
121  %add = add nsw i32 %sum.reload, %mul
122  %inc = add nsw i32 %i1.0, 1
123  store i32 %add, i32* %sum
124  %cmp = icmp slt i32 %i1.0, 100
125  br i1 %cmp, label %for.cond, label %for.end
126
127for.end:                                          ; preds = %for.cond
128  ret void
129}
130
131