aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJan Voung <jvoung@chromium.org>2013-08-30 16:42:36 -0700
committerJan Voung <jvoung@chromium.org>2013-08-30 16:42:36 -0700
commit121830a16cdb2685b1ac49bb88407644c044ef30 (patch)
tree1f8189150dc41b8b29609206cc12246afded44cc /test
parent06bf94d7c3fd693b3c6e3b71178514e5ed59489a (diff)
Revert some ARM byval localmods since byval+varargs are not in stable pexes.
Localmods came from: https://codereview.chromium.org/10825082/, and earlier. (1) The original change was so that byval parameters always go on the stack. That part was added because the original ARM code was buggy, and did not actually make a copy of the value, modifying the caller's struct (ouch!). (2) Then came a localmod to make all arguments following a byval go on the stack and to make the var-args code aware of that. This is so that arguments stay in the correct order for var-args to pick up. For (1) there has been some work upstream to make it work better. In any case, clang with --target=armv7a-...-gnueabi only used byval in some limited cases -- when the size of the struct is > 64 bytes where the backend will know that part of it could be in regs, and the rest can be memcpy'ed to the stack. For le32, clang will still generate byval without satisfying the same ARM condition (only for structs bigger than 64 bytes), so it could be *very bad* if we didn't have the ABI simpification passes rewrite the byval and try to let the ARM backend do things with byval... TEST=the GCC torture tests: va-arg-4.c, and 20030914-2.c and the example in issue 2746 still pass. BUG=none, cleanup R=dschuff@chromium.org Review URL: https://codereview.chromium.org/23691009
Diffstat (limited to 'test')
-rw-r--r--test/NaCl/Localmods/arm-byval-ref-fix.ll33
1 files changed, 0 insertions, 33 deletions
diff --git a/test/NaCl/Localmods/arm-byval-ref-fix.ll b/test/NaCl/Localmods/arm-byval-ref-fix.ll
deleted file mode 100644
index 13759a7f6a..0000000000
--- a/test/NaCl/Localmods/arm-byval-ref-fix.ll
+++ /dev/null
@@ -1,33 +0,0 @@
-; RUN: pnacl-llc -march=arm -mtriple=armv7a-none-nacl %s -o - | FileCheck %s
-
-; byval is currently crashing on ARM for upstream LLVM (PR11018).
-; We have a LOCALMOD in ARMISelLowering to simply leave byval wholly
-; on the stack, so this is expected to pass.
-
-%struct.S = type { i32, i32 }
-
-define void @foo(%struct.S* byval %w) nounwind {
-entry:
-
-; Verify that 55 is stored onto the stack directly, so the struct is
-; passed by value and not by reference.
-
-; CHECK: foo:
-; CHECK-NEXT: entry
-; CHECK-NEXT: mov [[REG:r[0-9]+]], #55
-; CHECK-NEXT: str [[REG]], [sp]
-
- %x = getelementptr inbounds %struct.S* %w, i32 0, i32 0
- store i32 55, i32* %x, align 4
- ret void
-}
-
-define i32 @main() nounwind {
-entry:
- %w = alloca %struct.S, align 4
- store %struct.S { i32 0, i32 0 }, %struct.S* %w
- call void @foo(%struct.S* byval %w)
- %x = getelementptr inbounds %struct.S* %w, i32 0, i32 0
- %retval = load i32* %x, align 4
- ret i32 %retval
-}