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

Side by Side Diff: gdb/testsuite/gdb.hp/gdb.aCC/run.c

Issue 11969036: Merge GDB 7.5.1 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@master
Patch Set: Created 7 years, 11 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 | « gdb/testsuite/gdb.hp/gdb.aCC/optimize.exp ('k') | gdb/testsuite/gdb.hp/gdb.aCC/watch-cmd.exp » ('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 * This simple classical example of recursion is useful for 2 * This simple classical example of recursion is useful for
3 * testing stack backtraces and such. 3 * testing stack backtraces and such.
4 */ 4 */
5 5
6 #ifdef vxworks 6 #ifdef vxworks
7 7
8 # include <stdio.h> 8 # include <stdio.h>
9 9
10 /* VxWorks does not supply atoi. */ 10 /* VxWorks does not supply atoi. */
(...skipping 24 matching lines...) Expand all
35 #else /* ! vxworks */ 35 #else /* ! vxworks */
36 # include <stdio.h> 36 # include <stdio.h>
37 # include <stdlib.h> 37 # include <stdlib.h>
38 #endif /* ! vxworks */ 38 #endif /* ! vxworks */
39 39
40 int main (int argc, char *argv[], char **envp) 40 int main (int argc, char *argv[], char **envp)
41 /*int argc; 41 /*int argc;
42 char *argv[], **envp;*/ 42 char *argv[], **envp;*/
43 { 43 {
44 int factorial (int); 44 int factorial (int);
45 #ifdef usestubs
46 set_debug_traps();
47 breakpoint();
48 #endif
49 #ifdef FAKEARGV 45 #ifdef FAKEARGV
50 printf ("%d\n", factorial (1)); 46 printf ("%d\n", factorial (1));
51 #else 47 #else
52 if (argc != 2) { 48 if (argc != 2) {
53 printf ("usage: factorial <number>\n"); 49 printf ("usage: factorial <number>\n");
54 return 1; 50 return 1;
55 } else { 51 } else {
56 printf ("%d\n", factorial (atoi (argv[1]))); 52 printf ("%d\n", factorial (atoi (argv[1])));
57 } 53 }
58 #endif 54 #endif
59 return 0; 55 return 0;
60 } 56 }
61 57
62 int factorial (int value) 58 int factorial (int value)
63 /*int value;*/ 59 /*int value;*/
64 { 60 {
65 int local_var; 61 int local_var;
66 62
67 if (value > 1) { 63 if (value > 1) {
68 value *= factorial (value - 1); 64 value *= factorial (value - 1);
69 } 65 }
70 local_var = value; 66 local_var = value;
71 return (value); 67 return (value);
72 } 68 }
OLDNEW
« no previous file with comments | « gdb/testsuite/gdb.hp/gdb.aCC/optimize.exp ('k') | gdb/testsuite/gdb.hp/gdb.aCC/watch-cmd.exp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698