Add unit tests for non-optimizing compiler regression found by doublec
							parent
							
								
									ca7bd0105d
								
							
						
					
					
						commit
						3adaa7a18e
					
				| 
						 | 
					@ -2,9 +2,11 @@
 | 
				
			||||||
! See http://factorcode.org/license.txt for BSD license.
 | 
					! See http://factorcode.org/license.txt for BSD license.
 | 
				
			||||||
!
 | 
					!
 | 
				
			||||||
USING: kernel tools.test strings namespaces make arrays sequences 
 | 
					USING: kernel tools.test strings namespaces make arrays sequences 
 | 
				
			||||||
       peg peg.private accessors words math accessors ;
 | 
					       peg peg.private peg.parsers accessors words math accessors ;
 | 
				
			||||||
IN: peg.tests
 | 
					IN: peg.tests
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[ ] [ reset-pegs ] unit-test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[
 | 
					[
 | 
				
			||||||
  "endbegin" "begin" token parse
 | 
					  "endbegin" "begin" token parse
 | 
				
			||||||
] must-fail
 | 
					] must-fail
 | 
				
			||||||
| 
						 | 
					@ -193,4 +195,16 @@ IN: peg.tests
 | 
				
			||||||
  "B" [ drop t ] satisfy [ 66 >= ] semantic parse
 | 
					  "B" [ drop t ] satisfy [ 66 >= ] semantic parse
 | 
				
			||||||
] unit-test
 | 
					] unit-test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{ f } [ \ + T{ parser f f f } equal? ] unit-test
 | 
					{ f } [ \ + T{ parser f f f } equal? ] unit-test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					USE: compiler
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[ ] [ disable-compiler ] unit-test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[ ] [ "" epsilon parse drop ] unit-test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[ ] [ enable-compiler ] unit-test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[ [ ] ] [ "" epsilon [ drop [ [ ] ] call ] action parse ] unit-test
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					[ [ ] ] [ "" epsilon [ drop [ [ ] ] ] action [ call ] action parse ] unit-test
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,6 @@
 | 
				
			||||||
IN: compiler.units.tests
 | 
					IN: compiler.units.tests
 | 
				
			||||||
USING: definitions compiler.units tools.test arrays sequences ;
 | 
					USING: definitions compiler.units tools.test arrays sequences words kernel
 | 
				
			||||||
 | 
					accessors ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[ flushed-dependency ] [ f flushed-dependency strongest-dependency ] unit-test
 | 
					[ flushed-dependency ] [ f flushed-dependency strongest-dependency ] unit-test
 | 
				
			||||||
[ flushed-dependency ] [ flushed-dependency f strongest-dependency ] unit-test
 | 
					[ flushed-dependency ] [ flushed-dependency f strongest-dependency ] unit-test
 | 
				
			||||||
| 
						 | 
					@ -7,3 +8,9 @@ USING: definitions compiler.units tools.test arrays sequences ;
 | 
				
			||||||
[ inlined-dependency ] [ called-dependency inlined-dependency strongest-dependency ] unit-test
 | 
					[ inlined-dependency ] [ called-dependency inlined-dependency strongest-dependency ] unit-test
 | 
				
			||||||
[ flushed-dependency ] [ called-dependency flushed-dependency strongest-dependency ] unit-test
 | 
					[ flushed-dependency ] [ called-dependency flushed-dependency strongest-dependency ] unit-test
 | 
				
			||||||
[ called-dependency ] [ called-dependency f strongest-dependency ] unit-test
 | 
					[ called-dependency ] [ called-dependency f strongest-dependency ] unit-test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					! Non-optimizing compiler bug
 | 
				
			||||||
 | 
					[ 1 1 ] [
 | 
				
			||||||
 | 
					    "A" "B" <word> [ [ 1 ] dip ] >>def dup f 2array 1array f modify-code-heap
 | 
				
			||||||
 | 
					    1 swap execute
 | 
				
			||||||
 | 
					] unit-test
 | 
				
			||||||
		Loading…
	
		Reference in New Issue