summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr21858.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr21858.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr21858.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr21858.c b/gcc/testsuite/gcc.dg/pr21858.c
new file mode 100644
index 000000000..41cd240c8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr21858.c
@@ -0,0 +1,15 @@
+/* Fold used to create a GT_EXPR of pointer vs. integer types,
+ which caused us to ICE in VRP. */
+
+/* { dg-do compile } */
+/* { dg-options "-Os -w" } */
+
+unsigned int dsdblm_GetBlockAddress();
+void error_LocalAssert(void);
+int dsdblm_CreateBlock(unsigned int address)
+{
+ address = dsdblm_GetBlockAddress();
+ if (address >= (void*)0x00020000)
+ error_LocalAssert();
+ return address;
+}