xref: /openbmc/qemu/tests/tcg/multiarch/segfault.c (revision 05caa062)
1 #include <stdio.h>
2 #include <string.h>
3 
4 /* Cause a segfault for testing purposes. */
5 
6 int main(int argc, char *argv[])
7 {
8     int *ptr = (void *)0xdeadbeef;
9 
10     if (argc == 2 && strcmp(argv[1], "-s") == 0) {
11         /* Cause segfault. */
12         printf("%d\n", *ptr);
13     }
14 }
15