X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Ftests%2Fuserprog%2Fno-vm%2Fmulti-oom.c;h=be0668a46d8c6dbbf94ef296abd10dca1296e586;hb=520ff4dd2a106a4d4a21468a72ba820c8ea7d242;hp=6a4472daed7575a319e0ee57cdf26836af34f5bd;hpb=ccf52d99d27e8dd88e594809d3ab7aab1efc8b8b;p=pintos-anon diff --git a/src/tests/userprog/no-vm/multi-oom.c b/src/tests/userprog/no-vm/multi-oom.c index 6a4472d..be0668a 100644 --- a/src/tests/userprog/no-vm/multi-oom.c +++ b/src/tests/userprog/no-vm/multi-oom.c @@ -27,8 +27,6 @@ static const int EXPECTED_DEPTH_TO_PASS = 30; static const int EXPECTED_REPETITIONS = 10; -const char *test_name = "multi-oom"; - enum child_termination_mode { RECURSE, CRASH }; /* Spawn a recursive copy of ourselves, passing along instructions @@ -67,15 +65,15 @@ consume_some_resources_and_die (int seed) { consume_some_resources (); random_init (seed); - int *PHYS_BASE = (int *)0xC0000000; + volatile int *PHYS_BASE = (volatile int *)0xC0000000; switch (random_ulong () % 5) { case 0: - *(int *) NULL = 42; + *(volatile int *) NULL = 42; case 1: - return *(int *) NULL; + return *(volatile int *) NULL; case 2: return *PHYS_BASE; @@ -107,6 +105,8 @@ main (int argc, char *argv[]) { int n; + test_name = "multi-oom"; + n = argc > 1 ? atoi (argv[1]) : 0; bool is_at_root = (n == 0); if (is_at_root)