diff mbox series

[1/2] add testcase for missing function designator expansion

Message ID 20181120024632.22747-2-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show
Series fix expansion of function designators | expand

Commit Message

Luc Van Oostenryck Nov. 20, 2018, 2:46 a.m. UTC
Add a testcase showing function designator are not expanded.

References: https://lore.kernel.org/lkml/1542623503-3755-1-git-send-email-yamada.masahi>
Reported-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 validation/expand/function-pointer.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 validation/expand/function-pointer.c
diff mbox series

Patch

diff --git a/validation/expand/function-pointer.c b/validation/expand/function-pointer.c
new file mode 100644
index 000000000..45aace161
--- /dev/null
+++ b/validation/expand/function-pointer.c
@@ -0,0 +1,23 @@ 
+struct s {
+	int (*fun)(void);
+};
+
+inline struct s *inl(struct s *p)
+{
+	1 + 0;
+	return p;
+}
+
+static void tst(struct s *s)
+{
+	inl(s)->fun();
+}
+
+/*
+ * check-name: function-pointer
+ * check-command: test-linearize -fdump-ir $file
+ * check-known-to-fail
+ *
+ * check-output-ignore
+ * check-output-excludes: add\\.32.*\\$1, \\$0
+ */