aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-04-17 15:07:39 -0700
committerMichael Forney <mforney@mforney.org>2019-04-17 20:10:52 -0700
commit2833c0041d669bc1ba7a6d13e7f92c23b84e04ae (patch)
tree785c3a487631778490d40dcb2d1b5809e2993ae2 /test
parent88aa3b6891678669548f01a0f87c36a993694320 (diff)
downloadcproc-2833c0041d669bc1ba7a6d13e7f92c23b84e04ae.tar.xz
Allow designators in __builtin_offsetof
Diffstat (limited to 'test')
-rw-r--r--test/builtin-offsetof.c9
-rw-r--r--test/builtin-offsetof.qbe1
2 files changed, 10 insertions, 0 deletions
diff --git a/test/builtin-offsetof.c b/test/builtin-offsetof.c
new file mode 100644
index 0000000..1737d0e
--- /dev/null
+++ b/test/builtin-offsetof.c
@@ -0,0 +1,9 @@
+struct s {
+ struct {
+ union {
+ float z;
+ char *c;
+ } b;
+ } a[5];
+};
+int x = __builtin_offsetof(struct s, a[2].b.c);
diff --git a/test/builtin-offsetof.qbe b/test/builtin-offsetof.qbe
new file mode 100644
index 0000000..1efe7e7
--- /dev/null
+++ b/test/builtin-offsetof.qbe
@@ -0,0 +1 @@
+export data $x = align 4 { w 16, }