diff options
Diffstat (limited to 'src/test/resources')
| -rw-r--r-- | src/test/resources/passes/Legalize/Legalize.fir | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/resources/passes/Legalize/Legalize.fir b/src/test/resources/passes/Legalize/Legalize.fir index 7e538695..a0a39845 100644 --- a/src/test/resources/passes/Legalize/Legalize.fir +++ b/src/test/resources/passes/Legalize/Legalize.fir @@ -39,3 +39,25 @@ circuit Legalize : when neq(bar_15, UInt(1)) : printf(clock, UInt(1), "Assertion failed!\n bar_15 != 0\n") stop(clock, UInt(1), 1) + + ; Check neg of literals + node negUInt0 = neg(UInt(123)) + when neq(negUInt0, SInt(-123)) : + printf(clock, UInt(1), "Assertion failed!\n negUInt0 != -123\n") + stop(clock, UInt(1), 1) + node negUInt1 = neg(UInt<8>(0)) + when neq(negUInt1, SInt<8>(0)) : + printf(clock, UInt(1), "Assertion failed!\n negUInt1 != 0\n") + stop(clock, UInt(1), 1) + node negSInt0 = neg(SInt(123)) + when neq(negSInt0, SInt(-123)) : + printf(clock, UInt(1), "Assertion failed!\n negSInt0 != -123\n") + stop(clock, UInt(1), 1) + node negSInt1 = neg(SInt(-123)) + when neq(negSInt1, SInt(123)) : + printf(clock, UInt(1), "Assertion failed!\n negSInt1 != 123\n") + stop(clock, UInt(1), 1) + node negSInt2 = neg(SInt(0)) + when neq(negSInt2, SInt(0)) : + printf(clock, UInt(1), "Assertion failed!\n negSInt2 != 0\n") + stop(clock, UInt(1), 1) |
