summaryrefslogtreecommitdiffstats
path: root/src/tests/vm/pt-grow-stack.c
diff options
context:
space:
mode:
authorFelipe Boeira <felipe.boeira@liu.se>2019-01-08 18:39:03 +0100
committerFelipe Boeira <felipe.boeira@liu.se>2019-01-08 18:39:03 +0100
commitd4522b8e9854178473adcea0fbb84f23f6e744bd (patch)
treefbcf620617c5023154eba3f965b3a982daa64a47 /src/tests/vm/pt-grow-stack.c
downloadpintos-d4522b8e9854178473adcea0fbb84f23f6e744bd.tar.gz
Initial commit
Diffstat (limited to 'src/tests/vm/pt-grow-stack.c')
-rw-r--r--src/tests/vm/pt-grow-stack.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/tests/vm/pt-grow-stack.c b/src/tests/vm/pt-grow-stack.c
new file mode 100644
index 0000000..0997a00
--- /dev/null
+++ b/src/tests/vm/pt-grow-stack.c
@@ -0,0 +1,20 @@
+/* Demonstrate that the stack can grow.
+ This must succeed. */
+
+#include <string.h>
+#include "tests/arc4.h"
+#include "tests/cksum.h"
+#include "tests/lib.h"
+#include "tests/main.h"
+
+void
+test_main (void)
+{
+ char stack_obj[4096];
+ struct arc4 arc4;
+
+ arc4_init (&arc4, "foobar", 6);
+ memset (stack_obj, 0, sizeof stack_obj);
+ arc4_crypt (&arc4, stack_obj, sizeof stack_obj);
+ msg ("cksum: %lu", cksum (stack_obj, sizeof stack_obj));
+}