aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/backend/constant-pointer.c
diff options
Diffstat (limited to 'validation/backend/constant-pointer.c')
-rw-r--r--validation/backend/constant-pointer.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/validation/backend/constant-pointer.c b/validation/backend/constant-pointer.c
new file mode 100644
index 00000000..9012c784
--- /dev/null
+++ b/validation/backend/constant-pointer.c
@@ -0,0 +1,24 @@
+extern int *ip[];
+
+void foo(void);
+void foo(void)
+{
+ ip[0] = (void *)0L;
+ ip[1] = (int *)0L;
+ ip[2] = (void *)0;
+ ip[3] = (int *)0;
+ ip[4] = (void *)(long)0;
+ ip[5] = (int *)(long)0;
+ ip[6] = (void *)123;
+ ip[7] = (int *)123;
+ ip[8] = (void *)123L;
+ ip[9] = (int *)123L;
+ ip[10] = (void *)(long)123;
+ ip[11] = (int *)(long)123;
+}
+
+/*
+ * check-name: constant pointers
+ * check-command: sparse-llvm $file
+ * check-output-ignore
+ */