aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2020-01-30 13:53:18 -0800
committerMichael Forney <mforney@mforney.org>2020-01-30 13:53:18 -0800
commit5b575aa2e3e42085d9087210b41560cf5849c746 (patch)
treeea8cdc078cc02eab821cc22cb099730188944ec1 /test
parent3849dd77204177fce2568b5bbace6e400c6a6064 (diff)
downloadcproc-5b575aa2e3e42085d9087210b41560cf5849c746.tar.xz
decl: Better check for inline definitions
Diffstat (limited to 'test')
-rw-r--r--test/inline-definition.c7
-rw-r--r--test/inline-definition.qbe6
2 files changed, 13 insertions, 0 deletions
diff --git a/test/inline-definition.c b/test/inline-definition.c
new file mode 100644
index 0000000..224b14c
--- /dev/null
+++ b/test/inline-definition.c
@@ -0,0 +1,7 @@
+extern void f(void);
+
+/*
+f is not an inline definition, due to the preceeding declaration,
+so we *should* emit an external definition for it.
+*/
+inline void f(void) {}
diff --git a/test/inline-definition.qbe b/test/inline-definition.qbe
new file mode 100644
index 0000000..2401635
--- /dev/null
+++ b/test/inline-definition.qbe
@@ -0,0 +1,6 @@
+export
+function $f() {
+@start.1
+@body.2
+ ret
+}