aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/linear/call-complex-pointer.c
diff options
Diffstat (limited to 'validation/linear/call-complex-pointer.c')
-rw-r--r--validation/linear/call-complex-pointer.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/validation/linear/call-complex-pointer.c b/validation/linear/call-complex-pointer.c
new file mode 100644
index 00000000..ea8232f1
--- /dev/null
+++ b/validation/linear/call-complex-pointer.c
@@ -0,0 +1,32 @@
+int foo(int p, int (*f0)(int), int (*f1)(int), int arg)
+{
+ return (p ? f0 : f1)(arg);
+}
+
+/*
+ * check-name: call-complex-pointer
+ * check-command: test-linearize -m64 -Wno-decl $file
+ *
+ * check-output-start
+foo:
+.L0:
+ <entry-point>
+ cbr %arg1, .L2, .L3
+
+.L2:
+ phisrc.64 %phi1 <- %arg2
+ br .L4
+
+.L3:
+ ptrcast.64 %r5 <- (64) %arg3
+ phisrc.64 %phi2 <- %r5
+ br .L4
+
+.L4:
+ phi.64 %r6 <- %phi1, %phi2
+ call.32 %r7 <- %r6, %arg4
+ ret.32 %r7
+
+
+ * check-output-end
+ */