blob: 6b405454f432a39cef60dcc5c84fccf001d30692 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
/** @file 410user/progs/stack_test1.c
* @author efaust
* @brief Tests whether auto-stack pages are zeroed.
* @public yes
* @for p3
* @covers autostack
* @status done
*
* Note: If we ever go back to the kernel-level autostack, we should revert
* this to the old one.
*/
#include <stdio.h>
#include <stdlib.h>
#include <syscall.h>
#include "410_tests.h"
#include <report.h>
DEF_TEST_NAME("stack_test1:");
#define SIZE (65536)
/* Can't you see that I am not afraid */
void touch_me_babe(char *arr, size_t len)
{
size_t i;
for(i = 0; i < len; i++) {
arr[i] = i;
}
}
void do_test()
{
char ca[SIZE];
touch_me_babe(ca, sizeof(ca));
}
int main()
{
report_start(START_CMPLT);
do_test();
report_misc("stack allocation successful");
report_end(END_SUCCESS);
exit(42);
}
|