diff options
Diffstat (limited to 'tests/tcg/multiarch/segfault.c')
-rw-r--r-- | tests/tcg/multiarch/segfault.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/tcg/multiarch/segfault.c b/tests/tcg/multiarch/segfault.c new file mode 100644 index 0000000..e6c8ff3 --- /dev/null +++ b/tests/tcg/multiarch/segfault.c @@ -0,0 +1,14 @@ +#include <stdio.h> +#include <string.h> + +/* Cause a segfault for testing purposes. */ + +int main(int argc, char *argv[]) +{ + int *ptr = (void *)0xdeadbeef; + + if (argc == 2 && strcmp(argv[1], "-s") == 0) { + /* Cause segfault. */ + printf("%d\n", *ptr); + } +} |