aboutsummaryrefslogtreecommitdiff
path: root/tests/i/extern-c-struct/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/i/extern-c-struct/lib.c')
-rw-r--r--tests/i/extern-c-struct/lib.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/i/extern-c-struct/lib.c b/tests/i/extern-c-struct/lib.c
new file mode 100644
index 0000000..39380ec
--- /dev/null
+++ b/tests/i/extern-c-struct/lib.c
@@ -0,0 +1,11 @@
+struct Sample {
+ char tag;
+ double value;
+ int count;
+};
+
+static struct Sample shared = {'G', 0.5, 7};
+
+void scale_sample(struct Sample *s, int k) { s->value *= k; }
+struct Sample *shared_sample(void) { return &shared; }
+int shared_count(void) { return shared.count; }