From 2833c0041d669bc1ba7a6d13e7f92c23b84e04ae Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Wed, 17 Apr 2019 15:07:39 -0700 Subject: Allow designators in __builtin_offsetof --- test/builtin-offsetof.c | 9 +++++++++ test/builtin-offsetof.qbe | 1 + 2 files changed, 10 insertions(+) create mode 100644 test/builtin-offsetof.c create mode 100644 test/builtin-offsetof.qbe (limited to 'test') 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, } -- cgit v1.2.3