]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/compiler/cfg/linear-scan/resolve/resolve-tests.factor
Delete empty unit tests files, remove 1- and 1+, reorder IN: lines in a lot of places...
[factor.git] / basis / compiler / cfg / linear-scan / resolve / resolve-tests.factor
index b5e95258bf916a8cb3fdcd4917226ac05c553e64..47c1f0ae76e673c6bc0b211708494cd933bf33e7 100644 (file)
@@ -1,7 +1,67 @@
-USING: arrays compiler.cfg.linear-scan.resolve kernel
-tools.test ;
+USING: compiler.cfg.linear-scan.resolve tools.test kernel namespaces
+accessors
+compiler.cfg
+compiler.cfg.instructions cpu.architecture make sequences
+compiler.cfg.linear-scan.allocation.state ;
 IN: compiler.cfg.linear-scan.resolve.tests
 
-[ { 1 2 3 4 5 6 } ] [
-    { 3 4 } V{ 1 2 } clone [ { 5 6 } 3append-here ] keep >array
+[
+    {
+        { { T{ spill-slot f 0 } int-rep } { 1 int-rep } }
+    }
+] [
+    [
+        0 <spill-slot> 1 int-rep add-mapping
+    ] { } make
+] unit-test
+
+[
+    {
+        T{ _reload { dst 1 } { rep int-rep } { n 0 } }
+    }
+] [
+    [
+        { T{ spill-slot f 0 } int-rep } { 1 int-rep } >insn
+    ] { } make
+] unit-test
+
+[
+    {
+        T{ _spill { src 1 } { rep int-rep } { n 0 } }
+    }
+] [
+    [
+        { 1 int-rep } { T{ spill-slot f 0 } int-rep } >insn
+    ] { } make
+] unit-test
+
+[
+    {
+        T{ ##copy { src 1 } { dst 2 } { rep int-rep } }
+    }
+] [
+    [
+        { 1 int-rep } { 2 int-rep } >insn
+    ] { } make
+] unit-test
+
+cfg new 8 >>spill-area-size cfg set
+H{ } clone spill-temps set
+
+[
+    t
+] [
+    { { { 0 int-rep } { 1 int-rep } } { { 1 int-rep } { 0 int-rep } } }
+    mapping-instructions {
+        {
+            T{ _spill { src 0 } { rep int-rep } { n 8 } }
+            T{ ##copy { dst 0 } { src 1 } { rep int-rep } }
+            T{ _reload { dst 1 } { rep int-rep } { n 8 } }
+        }
+        {
+            T{ _spill { src 1 } { rep int-rep } { n 8 } }
+            T{ ##copy { dst 1 } { src 0 } { rep int-rep } }
+            T{ _reload { dst 0 } { rep int-rep } { n 8 } }
+        }
+    } member?
 ] unit-test