aboutsummaryrefslogtreecommitdiff
path: root/test/builtin-offsetof.c
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/builtin-offsetof.c
parent88aa3b6891678669548f01a0f87c36a993694320 (diff)
Allow designators in __builtin_offsetof
Diffstat (limited to 'test/builtin-offsetof.c')
-rw-r--r--test/builtin-offsetof.c9
1 files changed, 9 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);