diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2014-10-30 16:37:57 +0000 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2014-10-30 16:41:36 +0000 |
commit | 0a6c459f713ff61769a02204cd736167e062bf4c (patch) | |
tree | 6e55afea5e0fd39eb4970b2ce3e689c4c0439857 /test | |
parent | d8e231c0f3f7349c89b2323af6313384353e4cc5 (diff) | |
download | art-0a6c459f713ff61769a02204cd736167e062bf4c.tar.gz art-0a6c459f713ff61769a02204cd736167e062bf4c.tar.bz2 art-0a6c459f713ff61769a02204cd736167e062bf4c.zip |
Fix for long parameter passed both in stack and register.
Fix for long parameter passed both in stack and register
on 32bits architectures.
The move to hard float ABI makes it so that the
register index does not necessarily match the stack index anymore.
Change-Id: I26b483f68ac86d336b4a37d94c38b04917668659
Diffstat (limited to 'test')
-rw-r--r-- | test/419-long-parameter/expected.txt | 0 | ||||
-rw-r--r-- | test/419-long-parameter/info.txt | 3 | ||||
-rw-r--r-- | test/419-long-parameter/src/Main.java | 34 |
3 files changed, 37 insertions, 0 deletions
diff --git a/test/419-long-parameter/expected.txt b/test/419-long-parameter/expected.txt new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/test/419-long-parameter/expected.txt diff --git a/test/419-long-parameter/info.txt b/test/419-long-parameter/info.txt new file mode 100644 index 0000000000..5eac9771a9 --- /dev/null +++ b/test/419-long-parameter/info.txt @@ -0,0 +1,3 @@ +Regression test for the long parameter passed both in stack and register +on 32bits architectures. The move to hard float ABI makes it so that the +register index does not necessarily match the stack index anymore. diff --git a/test/419-long-parameter/src/Main.java b/test/419-long-parameter/src/Main.java new file mode 100644 index 0000000000..808b7f616b --- /dev/null +++ b/test/419-long-parameter/src/Main.java @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +public class Main { + public static void main(String[] args) { + if ($opt$TestCallee(1.0, 2.0, 1L, 2L) != 1L) { + throw new Error("Unexpected result"); + } + if ($opt$TestCaller() != 1L) { + throw new Error("Unexpected result"); + } + } + + public static long $opt$TestCallee(double a, double b, long c, long d) { + return d - c; + } + + public static long $opt$TestCaller() { + return $opt$TestCallee(1.0, 2.0, 1L, 2L); + } +} |