]> gitweb.factorcode.org Git - factor.git/commitdiff
compiler.cfg.*: tests against #1308
authorBjörn Lindqvist <bjourne@gmail.com>
Tue, 28 Jul 2015 22:44:06 +0000 (00:44 +0200)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 29 Jul 2015 00:58:29 +0000 (17:58 -0700)
basis/compiler/cfg/ssa/destruction/coalescing/coalescing-tests.factor
basis/math/vectors/simd/simd-tests.factor

index 3af6d7d85ae9aed93d2f9b4f5bcc14839549f4b3..2e213d02c890cd816892abe839c9b0157a1b5b4e 100644 (file)
@@ -1,11 +1,25 @@
 USING: assocs compiler.cfg.def-use compiler.cfg.instructions
-compiler.cfg.ssa.destruction.coalescing
+compiler.cfg.registers compiler.cfg.ssa.destruction.coalescing
 compiler.cfg.ssa.destruction.leaders compiler.cfg.ssa.interference
 compiler.cfg.utilities cpu.architecture grouping kernel make
 namespaces random sequences tools.test ;
 QUALIFIED: sets
 IN: compiler.cfg.ssa.destruction.coalescing.tests
 
+! eliminatable-copy?
+{ { f t t f } } [
+    H{
+        { 45 double-2-rep }
+        { 46 double-rep }
+        { 47 double-rep }
+        { 100 double-rep }
+        { 20 tagged-rep }
+        { 30 int-rep }
+    } representations set
+    { { 45 46 } { 47 100 } { 20 30 } { 30 100 } }
+    [ first2 eliminatable-copy? ] map
+] unit-test
+
 ! initial-class-elements
 {
     H{
index fc50859c8fbc9bb5724e571e7e6e51d0733e471f..0883822b803a7d72580b2197753facb9bdc4d90f 100644 (file)
@@ -761,3 +761,13 @@ STRUCT: simd-struct
     [ 123 assert= ]
     bi*
 ] unit-test
+
+! #1308
+: test-1308 ( a b -- c )
+    { double-4 double-4 } declare
+    v+ dup first 10 > [ first ] [ third ] if 1array ;
+
+! Before the fix, this evaluated to an uninitialized value.
+{ 33.0 } [
+    double-4{ 2 20 30 40 } double-4{ 2 4 3 2 } test-1308 first
+] unit-test