aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/mem2reg/global-pointer.c
diff options
Diffstat (limited to 'validation/mem2reg/global-pointer.c')
-rw-r--r--validation/mem2reg/global-pointer.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/validation/mem2reg/global-pointer.c b/validation/mem2reg/global-pointer.c
new file mode 100644
index 00000000..d312577a
--- /dev/null
+++ b/validation/mem2reg/global-pointer.c
@@ -0,0 +1,26 @@
+int a, c, d;
+
+int foo_ptr(void)
+{
+ int b, *bp = &b;
+ int e, *ep = &e;
+
+ if (a)
+ *bp = c;
+ else
+ *bp = d;
+ if (c)
+ a = *bp;
+ if (b)
+ e = a;
+ return e;
+}
+
+/*
+ * check-name: global pointer
+ * check-command: test-linearize -Wno-decl -fdump-ir=mem2reg $file
+ * check-known-to-fail
+ * check-output-ignore
+ * check-output-pattern(4,5): load\\.
+ * check-output-pattern(3): store\\.
+ */