From 71a6ef7f0e10ad3dce5f46dcb1f2d456d32bc9a2 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Sat, 24 Mar 2007 21:55:26 +0000 Subject: [PATCH] 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. llvm-svn: 35301 --- llvm/test/Integer/a1.ll | 1 + llvm/test/Integer/a1.ll.out | 1 + llvm/test/Integer/a15.ll | 1 + llvm/test/Integer/a15.ll.out | 3 ++- llvm/test/Integer/a17.ll | 1 + llvm/test/Integer/a17.ll.out | 3 ++- llvm/test/Integer/a31.ll | 3 ++- llvm/test/Integer/a31.ll.out | 3 ++- llvm/test/Integer/a33.ll | 3 ++- llvm/test/Integer/a33.ll.out | 3 ++- llvm/test/Integer/a63.ll.out | 2 +- llvm/test/Integer/a7.ll.out | 2 +- llvm/test/Integer/a9.ll.out | 2 +- 13 files changed, 19 insertions(+), 9 deletions(-) diff --git a/llvm/test/Integer/a1.ll b/llvm/test/Integer/a1.ll index 0404d742e742..e63839867955 100644 --- a/llvm/test/Integer/a1.ll +++ b/llvm/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/llvm/test/Integer/a1.ll.out b/llvm/test/Integer/a1.ll.out index 0205e3bce8fe..8deafd6bf57b 100644 --- a/llvm/test/Integer/a1.ll.out +++ b/llvm/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/llvm/test/Integer/a15.ll b/llvm/test/Integer/a15.ll index 3fc4b1a77d7d..5c9dc3b1be0d 100644 --- a/llvm/test/Integer/a15.ll +++ b/llvm/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/llvm/test/Integer/a15.ll.out b/llvm/test/Integer/a15.ll.out index 69d3a1a48677..f900f165dbf3 100644 --- a/llvm/test/Integer/a15.ll.out +++ b/llvm/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/llvm/test/Integer/a17.ll b/llvm/test/Integer/a17.ll index 8d7485e90194..db03e7c6be0d 100644 --- a/llvm/test/Integer/a17.ll +++ b/llvm/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/llvm/test/Integer/a17.ll.out b/llvm/test/Integer/a17.ll.out index 3edb5ac01d33..de851adab3aa 100644 --- a/llvm/test/Integer/a17.ll.out +++ b/llvm/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/llvm/test/Integer/a31.ll b/llvm/test/Integer/a31.ll index 3d18b2a49e88..c0c571f63068 100644 --- a/llvm/test/Integer/a31.ll +++ b/llvm/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/llvm/test/Integer/a31.ll.out b/llvm/test/Integer/a31.ll.out index 243cabf7ed71..041525d02d14 100644 --- a/llvm/test/Integer/a31.ll.out +++ b/llvm/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/llvm/test/Integer/a33.ll b/llvm/test/Integer/a33.ll index ac9ce7cde990..f328907b4608 100644 --- a/llvm/test/Integer/a33.ll +++ b/llvm/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/llvm/test/Integer/a33.ll.out b/llvm/test/Integer/a33.ll.out index a5708acac29c..ec25d5214306 100644 --- a/llvm/test/Integer/a33.ll.out +++ b/llvm/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/llvm/test/Integer/a63.ll.out b/llvm/test/Integer/a63.ll.out index 1f732200499b..8fd98c7425cc 100644 --- a/llvm/test/Integer/a63.ll.out +++ b/llvm/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/llvm/test/Integer/a7.ll.out b/llvm/test/Integer/a7.ll.out index 6008372424e2..2aae073f4dd6 100644 --- a/llvm/test/Integer/a7.ll.out +++ b/llvm/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/llvm/test/Integer/a9.ll.out b/llvm/test/Integer/a9.ll.out index 7d25d4aa9049..963538b35f1b 100644 --- a/llvm/test/Integer/a9.ll.out +++ b/llvm/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]