Browse Source

nx regression test

This fails until we have nx bits working.

It does not work with Aki's patch, but I don't see why.

Change-Id: I43be290badc639ebb1a022a85794bff044233363
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Ronald G. Minnich 8 years ago
parent
commit
90ea4be2d9
2 changed files with 28 additions and 0 deletions
  1. 27 0
      sys/src/regress/nx.c
  2. 1 0
      sys/src/regress/regress.json

+ 27 - 0
sys/src/regress/nx.c

@@ -0,0 +1,27 @@
+#include <u.h>
+#include <libc.h>
+#define RET 0xc3
+
+void
+handler(void *v, char *s)
+{
+	print("PASS\n");
+	exits("PASS");
+}
+
+void
+main(void)
+{
+	void (*f)(void);
+	if (notify(handler)){
+		fprint(2, "%r\n");
+		exits("notify fails");
+	}
+
+	uint8_t *ret = malloc(1);
+	*ret = RET;
+	f = (void *)ret;
+	f();
+	print("FAIL");
+	exits("FAIL");
+}

+ 1 - 0
sys/src/regress/regress.json

@@ -16,6 +16,7 @@
 		"mixedfloat.c",
 		"mmap.c",
 		"nanotime.c",
+		"nx.c",
 		"privates.c",
 		"psx.c",
 		"syscall.c",