Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(745)

Unified Diff: tests/toolchain/call_with_misaligned_stack.S

Issue 508823007: Expose LLC's -force-align-stack flag to pnacl-translate (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: review Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pnacl/driver/pnacl-translate.py ('k') | tests/toolchain/nacl.scons » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/toolchain/call_with_misaligned_stack.S
diff --git a/tests/toolchain/call_with_misaligned_stack.S b/tests/toolchain/call_with_misaligned_stack.S
new file mode 100644
index 0000000000000000000000000000000000000000..7727f3e5c8d85e50c244934997f9ac25f62d79cc
--- /dev/null
+++ b/tests/toolchain/call_with_misaligned_stack.S
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2014 The Native Client Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/*
+ * Call the argument with a stack pointer 4 bytes below its value on entry.
+ * This will ensure that (assuming it's aligned on a 16-byte boundary on entry)
+ * it will be misaligned on entry to the callee.
+*/
+ .text
+ .p2align 5
+ .globl call_with_misaligned_stack
+ .type call_with_misaligned_stack, @function
+call_with_misaligned_stack:
+ movl 4(%esp), %ecx /* call target */
+ naclcall %ecx
+ pop %ecx
+ nacljmp %ecx
+ .p2align 5
« no previous file with comments | « pnacl/driver/pnacl-translate.py ('k') | tests/toolchain/nacl.scons » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698