From 5957d8ffd83836b534952921e9430216ecc14978 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Sat, 24 Mar 2007 21:55:26 +0000 Subject: Fix incorrect test cases for srem. The definition of srem is a remainder so that the sign of the result follows the sign of the divisor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35301 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Integer/a1.ll | 1 + test/Integer/a1.ll.out | 1 + test/Integer/a15.ll | 1 + test/Integer/a15.ll.out | 3 ++- test/Integer/a17.ll | 1 + test/Integer/a17.ll.out | 3 ++- test/Integer/a31.ll | 3 ++- test/Integer/a31.ll.out | 3 ++- test/Integer/a33.ll | 3 ++- test/Integer/a33.ll.out | 3 ++- test/Integer/a63.ll.out | 2 +- test/Integer/a7.ll.out | 2 +- test/Integer/a9.ll.out | 2 +- 13 files changed, 19 insertions(+), 9 deletions(-) (limited to 'test/Integer') diff --git a/test/Integer/a1.ll b/test/Integer/a1.ll index 0404d74..e638398 100644 --- a/test/Integer/a1.ll +++ b/test/Integer/a1.ll @@ -22,3 +22,4 @@ @r = constant i1 udiv(i1 1, i1 -1) @s = constant i1 srem(i1 -1, i1 1) ; overflow @t = constant i1 urem(i1 -1, i1 1) +@u = constant i1 srem(i1 1, i1 -1) ; overflow diff --git a/test/Integer/a1.ll.out b/test/Integer/a1.ll.out index 0205e3b..8deafd6 100644 --- a/test/Integer/a1.ll.out +++ b/test/Integer/a1.ll.out @@ -16,5 +16,6 @@ @r = constant i1 true ; [#uses=0] @s = constant i1 srem (i1 true, i1 true) ; [#uses=0] @t = constant i1 false ; [#uses=0] +@u = constant i1 srem (i1 true, i1 true) ; [#uses=0] implementation ; Functions: diff --git a/test/Integer/a15.ll b/test/Integer/a15.ll index 3fc4b1a..5c9dc3b 100644 --- a/test/Integer/a15.ll +++ b/test/Integer/a15.ll @@ -23,4 +23,5 @@ @u = constant i15 urem(i15 32767,i15 -1) @o = constant i15 trunc( i16 32768 to i15 ) @p = constant i15 trunc( i16 32767 to i15 ) +@v = constant i15 srem(i15 -1, i15 768) diff --git a/test/Integer/a15.ll.out b/test/Integer/a15.ll.out index 69d3a1a..f900f16 100644 --- a/test/Integer/a15.ll.out +++ b/test/Integer/a15.ll.out @@ -13,9 +13,10 @@ @q = constant i15 16381 ; [#uses=0] @r = constant i15 0 ; [#uses=0] @s = constant i15 2 ; [#uses=0] -@t = constant i15 1 ; [#uses=0] +@t = constant i15 -1 ; [#uses=0] @u = constant i15 0 ; [#uses=0] @o = constant i15 0 ; [#uses=0] @p = constant i15 -1 ; [#uses=0] +@v = constant i15 1 ; [#uses=0] implementation ; Functions: diff --git a/test/Integer/a17.ll b/test/Integer/a17.ll index 8d7485e..db03e7c 100644 --- a/test/Integer/a17.ll +++ b/test/Integer/a17.ll @@ -22,3 +22,4 @@ @t = constant i17 urem(i17 131071,i17 -1) @o = constant i17 trunc( i18 131072 to i17 ) @p = constant i17 trunc( i18 131071 to i17 ) +@v = constant i17 srem(i17 -1, i17 15) diff --git a/test/Integer/a17.ll.out b/test/Integer/a17.ll.out index 3edb5ac..de851ad 100644 --- a/test/Integer/a17.ll.out +++ b/test/Integer/a17.ll.out @@ -12,9 +12,10 @@ @n = constant i17 -2 ; [#uses=0] @q = constant i17 0 ; [#uses=0] @r = constant i17 2 ; [#uses=0] -@s = constant i17 1 ; [#uses=0] +@s = constant i17 -1 ; [#uses=0] @t = constant i17 0 ; [#uses=0] @o = constant i17 0 ; [#uses=0] @p = constant i17 -1 ; [#uses=0] +@v = constant i17 1 ; [#uses=0] implementation ; Functions: diff --git a/test/Integer/a31.ll b/test/Integer/a31.ll index 3d18b2a..c0c571f 100644 --- a/test/Integer/a31.ll +++ b/test/Integer/a31.ll @@ -18,7 +18,8 @@ @n = constant i31 mul(i31 2147483647, i31 2) @q = constant i31 sdiv(i31 -1, i31 1073741823) @r = constant i31 udiv(i31 -1, i31 1073741823) -@s = constant i31 srem(i31 3, i31 2147483646) +@s = constant i31 srem(i31 1, i31 2147483646) @t = constant i31 urem(i31 2147483647,i31 -1) @o = constant i31 trunc( i32 2147483648 to i31 ) @p = constant i31 trunc( i32 2147483647 to i31 ) +@u = constant i31 srem(i31 -3, i31 17) diff --git a/test/Integer/a31.ll.out b/test/Integer/a31.ll.out index 243cabf..041525d 100644 --- a/test/Integer/a31.ll.out +++ b/test/Integer/a31.ll.out @@ -12,9 +12,10 @@ @n = constant i31 -2 ; [#uses=0] @q = constant i31 0 ; [#uses=0] @r = constant i31 2 ; [#uses=0] -@s = constant i31 1 ; [#uses=0] +@s = constant i31 -1 ; [#uses=0] @t = constant i31 0 ; [#uses=0] @o = constant i31 0 ; [#uses=0] @p = constant i31 -1 ; [#uses=0] +@u = constant i31 3 ; [#uses=0] implementation ; Functions: diff --git a/test/Integer/a33.ll b/test/Integer/a33.ll index ac9ce7c..f328907 100644 --- a/test/Integer/a33.ll +++ b/test/Integer/a33.ll @@ -18,8 +18,9 @@ @n = constant i33 mul(i33 8589934591, i33 2) @q = constant i33 sdiv(i33 -1, i33 4294967295) @r = constant i33 udiv(i33 -1, i33 4294967295) -@s = constant i33 srem(i33 3, i33 8589934590) +@s = constant i33 srem(i33 1, i33 8589934590) @t = constant i33 urem(i33 8589934591,i33 -1) @o = constant i33 trunc( i34 8589934592 to i33 ) @p = constant i33 trunc( i34 8589934591 to i33 ) +@u = constant i33 srem(i33 -1, i33 17) diff --git a/test/Integer/a33.ll.out b/test/Integer/a33.ll.out index a5708ac..ec25d52 100644 --- a/test/Integer/a33.ll.out +++ b/test/Integer/a33.ll.out @@ -12,9 +12,10 @@ @n = constant i33 -2 ; [#uses=0] @q = constant i33 0 ; [#uses=0] @r = constant i33 2 ; [#uses=0] -@s = constant i33 1 ; [#uses=0] +@s = constant i33 -1 ; [#uses=0] @t = constant i33 0 ; [#uses=0] @o = constant i33 0 ; [#uses=0] @p = constant i33 -1 ; [#uses=0] +@u = constant i33 1 ; [#uses=0] implementation ; Functions: diff --git a/test/Integer/a63.ll.out b/test/Integer/a63.ll.out index 1f73220..8fd98c7 100644 --- a/test/Integer/a63.ll.out +++ b/test/Integer/a63.ll.out @@ -13,7 +13,7 @@ @q = constant i63 0 ; [#uses=0] @u = constant i63 -1 ; [#uses=0] @r = constant i63 2 ; [#uses=0] -@s = constant i63 1 ; [#uses=0] +@s = constant i63 -1 ; [#uses=0] @t = constant i63 0 ; [#uses=0] @o = constant i63 0 ; [#uses=0] @p = constant i63 -1 ; [#uses=0] diff --git a/test/Integer/a7.ll.out b/test/Integer/a7.ll.out index 6008372..2aae073 100644 --- a/test/Integer/a7.ll.out +++ b/test/Integer/a7.ll.out @@ -18,7 +18,7 @@ @u = constant i7 -64 ; [#uses=0] @v = constant i7 0 ; [#uses=0] @w = constant i7 2 ; [#uses=0] -@x = constant i7 1 ; [#uses=0] +@x = constant i7 -1 ; [#uses=0] @y = constant i7 0 ; [#uses=0] @o = constant i7 0 ; [#uses=0] @p = constant i7 -1 ; [#uses=0] diff --git a/test/Integer/a9.ll.out b/test/Integer/a9.ll.out index 7d25d4a..963538b 100644 --- a/test/Integer/a9.ll.out +++ b/test/Integer/a9.ll.out @@ -13,7 +13,7 @@ @q = constant i9 0 ; [#uses=0] @r = constant i9 255 ; [#uses=0] @s = constant i9 0 ; [#uses=0] -@t = constant i9 1 ; [#uses=0] +@t = constant i9 -1 ; [#uses=0] @o = constant i9 0 ; [#uses=0] @p = constant i9 -1 ; [#uses=0] -- cgit v1.1