summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr36227.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/torture/pr36227.c')
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr36227.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr36227.c b/gcc/testsuite/gcc.dg/torture/pr36227.c
new file mode 100644
index 000000000..462b2c4f0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr36227.c
@@ -0,0 +1,17 @@
+/* { dg-do run { target { stdint_types } } } */
+
+#include <stdint.h>
+extern void abort (void);
+int main()
+{
+ int i = 1;
+ int *p = &i;
+ uintptr_t iptr;
+
+ iptr = (uintptr_t)p - (uintptr_t)&iptr;
+ p = (int *)((uintptr_t)&iptr + iptr);
+ if (*p != 1)
+ abort ();
+ return 0;
+}
+