diff options
author | Andreas Gampe <agampe@google.com> | 2015-04-09 16:04:55 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-04-09 16:04:56 +0000 |
commit | 19361054a362957e152db65c9033408486c6af28 (patch) | |
tree | 18519c3e1872caedd46d37f7b4e29a8329b7710c | |
parent | f06bb7c986231d91ffa2a85f8ad15f9a7ce8943e (diff) | |
parent | f9a627f7b7703d6f2a9db8ead651db7683ef4825 (diff) | |
download | art-19361054a362957e152db65c9033408486c6af28.zip art-19361054a362957e152db65c9033408486c6af28.tar.gz art-19361054a362957e152db65c9033408486c6af28.tar.bz2 |
Merge "Add test cases to make sure GenDivRemLit() handles 16-bit constants correctly."
-rw-r--r-- | test/107-int-math2/src/Main.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/107-int-math2/src/Main.java b/test/107-int-math2/src/Main.java index f0fe934..6a6227c 100644 --- a/test/107-int-math2/src/Main.java +++ b/test/107-int-math2/src/Main.java @@ -379,7 +379,7 @@ class Main extends IntMathBase { */ static int lit16Test(int x) { - int[] results = new int[8]; + int[] results = new int[10]; /* try to generate op-int/lit16" instructions */ results[0] = x + 1000; @@ -390,6 +390,9 @@ class Main extends IntMathBase { results[5] = x & 1000; results[6] = x | -1000; results[7] = x ^ -1000; + /* use an 16-bit constant that has its MSB (bit-15) set */ + results[8] = x / 32769; + results[9] = x / -32769; if (results[0] != 78777) { return 1; } if (results[1] != -76777) { return 2; } @@ -399,6 +402,8 @@ class Main extends IntMathBase { if (results[5] != 960) { return 6; } if (results[6] != -39) { return 7; } if (results[7] != -76855) { return 8; } + if (results[8] != 2) { return 9; } + if (results[9] != -2) { return 10; } return 0; } |