add basic isl_union_access_info_compute_flow tests
authorSven Verdoolaege <sven.verdoolaege@gmail.com>
Tue, 9 May 2017 12:40:49 +0000 (9 14:40 +0200)
committerSven Verdoolaege <sven.verdoolaege@gmail.com>
Mon, 12 Jun 2017 13:48:50 +0000 (12 15:48 +0200)
isl_test.c already contains an isl_union_access_info_compute_flow test,
but it is rather specialized.  It is easier to specify tests
using the isl_flow application.
This infrastructure will then also make it easier to test
an improvement of isl_union_access_info_compute_flow that
will be introduced in an upcoming commit.

Signed-off-by: Sven Verdoolaege <sven.verdoolaege@gmail.com>
31 files changed:
Makefile.am
configure.ac
flow_test.sh.in [new file with mode: 0644]
test_inputs/flow/loop-tree.ai [new file with mode: 0644]
test_inputs/flow/loop-tree.flow [new file with mode: 0644]
test_inputs/flow/loop.ai [new file with mode: 0644]
test_inputs/flow/loop.flow [new file with mode: 0644]
test_inputs/flow/may_loop-tree.ai [new file with mode: 0644]
test_inputs/flow/may_loop-tree.flow [new file with mode: 0644]
test_inputs/flow/may_loop.ai [new file with mode: 0644]
test_inputs/flow/may_loop.flow [new file with mode: 0644]
test_inputs/flow/mixed_loop-tree.ai [new file with mode: 0644]
test_inputs/flow/mixed_loop-tree.flow [new file with mode: 0644]
test_inputs/flow/mixed_loop.ai [new file with mode: 0644]
test_inputs/flow/mixed_loop.flow [new file with mode: 0644]
test_inputs/flow/no_source-tree.ai [new file with mode: 0644]
test_inputs/flow/no_source-tree.flow [new file with mode: 0644]
test_inputs/flow/no_source.ai [new file with mode: 0644]
test_inputs/flow/no_source.flow [new file with mode: 0644]
test_inputs/flow/no_source2-tree.ai [new file with mode: 0644]
test_inputs/flow/no_source2-tree.flow [new file with mode: 0644]
test_inputs/flow/no_source2.ai [new file with mode: 0644]
test_inputs/flow/no_source2.flow [new file with mode: 0644]
test_inputs/flow/single_may_source-tree.ai [new file with mode: 0644]
test_inputs/flow/single_may_source-tree.flow [new file with mode: 0644]
test_inputs/flow/single_may_source.ai [new file with mode: 0644]
test_inputs/flow/single_may_source.flow [new file with mode: 0644]
test_inputs/flow/single_source-tree.ai [new file with mode: 0644]
test_inputs/flow/single_source-tree.flow [new file with mode: 0644]
test_inputs/flow/single_source.ai [new file with mode: 0644]
test_inputs/flow/single_source.flow [new file with mode: 0644]

index a872a51..b3b5d1f 100644 (file)
@@ -13,7 +13,8 @@ noinst_PROGRAMS = isl_test isl_polyhedron_sample isl_pip \
        isl_polyhedron_detect_equalities isl_cat \
        isl_closure isl_bound isl_schedule isl_codegen isl_test_int \
        isl_flow isl_flow_cmp
-TESTS = isl_test codegen_test.sh pip_test.sh bound_test.sh isl_test_int
+TESTS = isl_test codegen_test.sh pip_test.sh bound_test.sh isl_test_int \
+       flow_test.sh
 
 if IMATH_FOR_MP
 
index 7e87015..2a4f160 100644 (file)
@@ -137,6 +137,7 @@ fi
 AC_CONFIG_FILES([bound_test.sh], [chmod +x bound_test.sh])
 AC_CONFIG_FILES([codegen_test.sh], [chmod +x codegen_test.sh])
 AC_CONFIG_FILES([pip_test.sh], [chmod +x pip_test.sh])
+AC_CONFIG_FILES([flow_test.sh], [chmod +x flow_test.sh])
 AC_CONFIG_COMMANDS_POST([
        dnl pass on arguments to subdir configures, but don't
        dnl add them to config.status
diff --git a/flow_test.sh.in b/flow_test.sh.in
new file mode 100644 (file)
index 0000000..fa9177c
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+EXEEXT=@EXEEXT@
+srcdir=@srcdir@
+
+failed=0
+
+for i in $srcdir/test_inputs/flow/*.ai; do
+       echo $i;
+       base=`basename $i .ai`
+       test=test-$base.flow
+       dir=`dirname $i`
+       ref=$dir/$base.flow
+       (./isl_flow$EXEEXT < $i > $test &&
+       ./isl_flow_cmp$EXEEXT $ref $test && rm $test) || failed=1
+done
+
+test $failed -eq 0 || exit
diff --git a/test_inputs/flow/loop-tree.ai b/test_inputs/flow/loop-tree.ai
new file mode 100644 (file)
index 0000000..e7fa351
--- /dev/null
@@ -0,0 +1,10 @@
+sink: "{ S[] -> a[] }"
+must_source: "{ T[i] -> a[] : 0 <= i <= 9 }"
+schedule:
+  domain: "{ T[i]; S[] }"
+  child:
+    sequence:
+    - filter: "{ T[i] }"
+      child:
+        schedule: "[{ T[i] -> [(i)] }]"
+    - filter: "{ S[] }"
diff --git a/test_inputs/flow/loop-tree.flow b/test_inputs/flow/loop-tree.flow
new file mode 100644 (file)
index 0000000..ef089e5
--- /dev/null
@@ -0,0 +1,4 @@
+must_dependence: "{ T[i = 9] -> [S[] -> a[]] }"
+may_dependence: "{ T[i = 9] -> [S[] -> a[]] }"
+must_no_source: "{  }"
+may_no_source: "{  }"
diff --git a/test_inputs/flow/loop.ai b/test_inputs/flow/loop.ai
new file mode 100644 (file)
index 0000000..88c6efa
--- /dev/null
@@ -0,0 +1,3 @@
+sink: { S[] -> a[] }
+must_source: { T[i] -> a[] : 0 <= i < 10 }
+schedule_map: { T[i] -> [0,i]; S[] -> [1,0] }
diff --git a/test_inputs/flow/loop.flow b/test_inputs/flow/loop.flow
new file mode 100644 (file)
index 0000000..ef089e5
--- /dev/null
@@ -0,0 +1,4 @@
+must_dependence: "{ T[i = 9] -> [S[] -> a[]] }"
+may_dependence: "{ T[i = 9] -> [S[] -> a[]] }"
+must_no_source: "{  }"
+may_no_source: "{  }"
diff --git a/test_inputs/flow/may_loop-tree.ai b/test_inputs/flow/may_loop-tree.ai
new file mode 100644 (file)
index 0000000..de44645
--- /dev/null
@@ -0,0 +1,10 @@
+sink: "{ S[] -> a[] }"
+may_source: "{ T[i] -> a[] : 0 <= i <= 9 }"
+schedule:
+  domain: "{ T[i]; S[] }"
+  child:
+    sequence:
+    - filter: "{ T[i] }"
+      child:
+        schedule: "[{ T[i] -> [(i)] }]"
+    - filter: "{ S[] }"
diff --git a/test_inputs/flow/may_loop-tree.flow b/test_inputs/flow/may_loop-tree.flow
new file mode 100644 (file)
index 0000000..f944ee2
--- /dev/null
@@ -0,0 +1,4 @@
+must_dependence: "{  }"
+may_dependence: "{ T[i] -> [S[] -> a[]] : 0 <= i <= 9 }"
+must_no_source: "{  }"
+may_no_source: "{ S[] -> a[] }"
diff --git a/test_inputs/flow/may_loop.ai b/test_inputs/flow/may_loop.ai
new file mode 100644 (file)
index 0000000..0a52ce5
--- /dev/null
@@ -0,0 +1,3 @@
+sink: { S[] -> a[] }
+may_source: { T[i] -> a[] : 0 <= i < 10 }
+schedule_map: { T[i] -> [0,i]; S[] -> [1,0] }
diff --git a/test_inputs/flow/may_loop.flow b/test_inputs/flow/may_loop.flow
new file mode 100644 (file)
index 0000000..f944ee2
--- /dev/null
@@ -0,0 +1,4 @@
+must_dependence: "{  }"
+may_dependence: "{ T[i] -> [S[] -> a[]] : 0 <= i <= 9 }"
+must_no_source: "{  }"
+may_no_source: "{ S[] -> a[] }"
diff --git a/test_inputs/flow/mixed_loop-tree.ai b/test_inputs/flow/mixed_loop-tree.ai
new file mode 100644 (file)
index 0000000..960bafb
--- /dev/null
@@ -0,0 +1,11 @@
+sink: "{ S[] -> a[] }"
+must_source: "{ T[i] -> a[] : 2*floor((i)/2) = i and 0 <= i <= 9 }"
+may_source: "{ T[i] -> a[] : 2*floor((1 + i)/2) = 1 + i and 0 <= i <= 9 }"
+schedule:
+  domain: "{ T[i]; S[] }"
+  child:
+    sequence:
+    - filter: "{ T[i] }"
+      child:
+        schedule: "[{ T[i] -> [(i)] }]"
+    - filter: "{ S[] }"
diff --git a/test_inputs/flow/mixed_loop-tree.flow b/test_inputs/flow/mixed_loop-tree.flow
new file mode 100644 (file)
index 0000000..76033be
--- /dev/null
@@ -0,0 +1,4 @@
+must_dependence: "{  }"
+may_dependence: "{ T[i = 9] -> [S[] -> a[]]; T[i = 8] -> [S[] -> a[]] }"
+must_no_source: "{  }"
+may_no_source: "{  }"
diff --git a/test_inputs/flow/mixed_loop.ai b/test_inputs/flow/mixed_loop.ai
new file mode 100644 (file)
index 0000000..c797820
--- /dev/null
@@ -0,0 +1,4 @@
+sink: { S[] -> a[] }
+must_source: { T[i] -> a[] : 0 <= i < 10 and i mod 2 = 0 }
+may_source: { T[i] -> a[] : 0 <= i < 10 and i mod 2 = 1 }
+schedule_map: { T[i] -> [0,i]; S[] -> [1,0] }
diff --git a/test_inputs/flow/mixed_loop.flow b/test_inputs/flow/mixed_loop.flow
new file mode 100644 (file)
index 0000000..76033be
--- /dev/null
@@ -0,0 +1,4 @@
+must_dependence: "{  }"
+may_dependence: "{ T[i = 9] -> [S[] -> a[]]; T[i = 8] -> [S[] -> a[]] }"
+must_no_source: "{  }"
+may_no_source: "{  }"
diff --git a/test_inputs/flow/no_source-tree.ai b/test_inputs/flow/no_source-tree.ai
new file mode 100644 (file)
index 0000000..e3eea6d
--- /dev/null
@@ -0,0 +1,3 @@
+sink: "{ S[] -> a[] }"
+schedule:
+  domain: "{ S[] }"
diff --git a/test_inputs/flow/no_source-tree.flow b/test_inputs/flow/no_source-tree.flow
new file mode 100644 (file)
index 0000000..2ed34cd
--- /dev/null
@@ -0,0 +1,4 @@
+must_dependence: "{  }"
+may_dependence: "{  }"
+must_no_source: "{ S[] -> a[] }"
+may_no_source: "{ S[] -> a[] }"
diff --git a/test_inputs/flow/no_source.ai b/test_inputs/flow/no_source.ai
new file mode 100644 (file)
index 0000000..52b07d6
--- /dev/null
@@ -0,0 +1,2 @@
+sink: { S[] -> a[] }
+schedule_map: { S[] -> [] }
diff --git a/test_inputs/flow/no_source.flow b/test_inputs/flow/no_source.flow
new file mode 100644 (file)
index 0000000..2ed34cd
--- /dev/null
@@ -0,0 +1,4 @@
+must_dependence: "{  }"
+may_dependence: "{  }"
+must_no_source: "{ S[] -> a[] }"
+may_no_source: "{ S[] -> a[] }"
diff --git a/test_inputs/flow/no_source2-tree.ai b/test_inputs/flow/no_source2-tree.ai
new file mode 100644 (file)
index 0000000..1ef6e52
--- /dev/null
@@ -0,0 +1,8 @@
+sink: "{ S[] -> a[] }"
+must_source: "{ T[] -> a[] }"
+schedule:
+  domain: "{ S[]; T[] }"
+  child:
+    sequence:
+    - filter: "{ S[] }"
+    - filter: "{ T[] }"
diff --git a/test_inputs/flow/no_source2-tree.flow b/test_inputs/flow/no_source2-tree.flow
new file mode 100644 (file)
index 0000000..2ed34cd
--- /dev/null
@@ -0,0 +1,4 @@
+must_dependence: "{  }"
+may_dependence: "{  }"
+must_no_source: "{ S[] -> a[] }"
+may_no_source: "{ S[] -> a[] }"
diff --git a/test_inputs/flow/no_source2.ai b/test_inputs/flow/no_source2.ai
new file mode 100644 (file)
index 0000000..b13e798
--- /dev/null
@@ -0,0 +1,3 @@
+sink: { S[] -> a[] }
+must_source: { T[] -> a[] }
+schedule_map: { T[] -> [1]; S[] -> [0] }
diff --git a/test_inputs/flow/no_source2.flow b/test_inputs/flow/no_source2.flow
new file mode 100644 (file)
index 0000000..2ed34cd
--- /dev/null
@@ -0,0 +1,4 @@
+must_dependence: "{  }"
+may_dependence: "{  }"
+must_no_source: "{ S[] -> a[] }"
+may_no_source: "{ S[] -> a[] }"
diff --git a/test_inputs/flow/single_may_source-tree.ai b/test_inputs/flow/single_may_source-tree.ai
new file mode 100644 (file)
index 0000000..f05980a
--- /dev/null
@@ -0,0 +1,8 @@
+sink: "{ S[] -> a[] }"
+may_source: "{ T[] -> a[] }"
+schedule:
+  domain: "{ S[]; T[] }"
+  child:
+    sequence:
+    - filter: "{ T[] }"
+    - filter: "{ S[] }"
diff --git a/test_inputs/flow/single_may_source-tree.flow b/test_inputs/flow/single_may_source-tree.flow
new file mode 100644 (file)
index 0000000..3034b85
--- /dev/null
@@ -0,0 +1,4 @@
+must_dependence: "{  }"
+may_dependence: "{ T[] -> [S[] -> a[]] }"
+must_no_source: "{  }"
+may_no_source: "{ S[] -> a[] }"
diff --git a/test_inputs/flow/single_may_source.ai b/test_inputs/flow/single_may_source.ai
new file mode 100644 (file)
index 0000000..58d0a7f
--- /dev/null
@@ -0,0 +1,3 @@
+sink: { S[] -> a[] }
+may_source: { T[] -> a[] }
+schedule_map: { T[] -> [0]; S[] -> [1] }
diff --git a/test_inputs/flow/single_may_source.flow b/test_inputs/flow/single_may_source.flow
new file mode 100644 (file)
index 0000000..3034b85
--- /dev/null
@@ -0,0 +1,4 @@
+must_dependence: "{  }"
+may_dependence: "{ T[] -> [S[] -> a[]] }"
+must_no_source: "{  }"
+may_no_source: "{ S[] -> a[] }"
diff --git a/test_inputs/flow/single_source-tree.ai b/test_inputs/flow/single_source-tree.ai
new file mode 100644 (file)
index 0000000..3af5f2f
--- /dev/null
@@ -0,0 +1,8 @@
+sink: "{ S[] -> a[] }"
+must_source: "{ T[] -> a[] }"
+schedule:
+  domain: "{ S[]; T[] }"
+  child:
+    sequence:
+    - filter: "{ T[] }"
+    - filter: "{ S[] }"
diff --git a/test_inputs/flow/single_source-tree.flow b/test_inputs/flow/single_source-tree.flow
new file mode 100644 (file)
index 0000000..e72b8d7
--- /dev/null
@@ -0,0 +1,4 @@
+must_dependence: "{ T[] -> [S[] -> a[]] }"
+may_dependence: "{ T[] -> [S[] -> a[]] }"
+must_no_source: "{  }"
+may_no_source: "{  }"
diff --git a/test_inputs/flow/single_source.ai b/test_inputs/flow/single_source.ai
new file mode 100644 (file)
index 0000000..0a00e5b
--- /dev/null
@@ -0,0 +1,3 @@
+sink: { S[] -> a[] }
+must_source: { T[] -> a[] }
+schedule_map: { T[] -> [0]; S[] -> [1] }
diff --git a/test_inputs/flow/single_source.flow b/test_inputs/flow/single_source.flow
new file mode 100644 (file)
index 0000000..e72b8d7
--- /dev/null
@@ -0,0 +1,4 @@
+must_dependence: "{ T[] -> [S[] -> a[]] }"
+may_dependence: "{ T[] -> [S[] -> a[]] }"
+must_no_source: "{  }"
+may_no_source: "{  }"