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

Side by Side Diff: tests/toolchain/eh_return.c

Issue 12256018: [MIPS] Add remaining parts for building tests for MIPS (Closed) Base URL: http://src.chromium.org/native_client/trunk/src/native_client/
Patch Set: Minor cleanup. Created 7 years, 9 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 unified diff | Download patch
« no previous file with comments | « tests/stubout_mode/partly_invalid.c ('k') | tests/toolchain/stack_frame.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 /* This test is guarding against regressions wrt 7 /* This test is guarding against regressions wrt
8 __builtin_eh_return (offset, handler) 8 __builtin_eh_return (offset, handler)
9 especially for pnacl 9 especially for pnacl
10 The behavior of this builtin is not seem to be well defined. 10 The behavior of this builtin is not seem to be well defined.
11 It does not even exist for arm, so we empirically determine 11 It does not even exist for arm, so we empirically determine
12 values for STACK_REMAINDER which make the builtin 12 values for STACK_REMAINDER which make the builtin
13 behave like a tail-call for testing. 13 behave like a tail-call for testing.
14 */ 14 */
15 #include "native_client/tests/toolchain/eh_helper.h" 15 #include "native_client/tests/toolchain/eh_helper.h"
16 #include "native_client/tests/toolchain/utils.h" 16 #include "native_client/tests/toolchain/utils.h"
17 17
18 18
19 void* dummy0_cfa = 0; 19 void* dummy0_cfa = 0;
20 void* return_address = 0; 20 void* return_address = 0;
21 21
22 /* STACK_REMAINDER is to compensate for the 22 /* STACK_REMAINDER is to compensate for the
23 * return address slot which is still on the stack on x86. 23 * return address slot which is still on the stack on x86.
24 */ 24 */
25 #if defined(__arm__) 25 #if defined(__arm__)
26 #define STACK_REMAINDER 0L 26 #define STACK_REMAINDER 0L
27 #elif defined(__mips__)
28 #define STACK_REMAINDER 0L
27 #elif defined(__i386__) 29 #elif defined(__i386__)
28 #define STACK_REMAINDER -4L 30 #define STACK_REMAINDER -4L
29 #elif defined(__x86_64__) 31 #elif defined(__x86_64__)
30 #define STACK_REMAINDER -8L 32 #define STACK_REMAINDER -8L
31 #else 33 #else
32 #error "unknown arch" 34 #error "unknown arch"
33 #endif 35 #endif
34 36
35 /* prevent inlining, especially into main */ 37 /* prevent inlining, especially into main */
36 void dummy3() __attribute__((noinline)); 38 void dummy3() __attribute__((noinline));
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 next_step(2); 81 next_step(2);
80 __builtin_eh_return (STACK_REMAINDER, dummy1); 82 __builtin_eh_return (STACK_REMAINDER, dummy1);
81 } 83 }
82 84
83 int main(int argc, char* argv[]) { 85 int main(int argc, char* argv[]) {
84 next_step(1); 86 next_step(1);
85 dummy0(); 87 dummy0();
86 /* Should not get here */ 88 /* Should not get here */
87 abort(); 89 abort();
88 } 90 }
OLDNEW
« no previous file with comments | « tests/stubout_mode/partly_invalid.c ('k') | tests/toolchain/stack_frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698