aboutsummaryrefslogtreecommitdiff
path: root/clang/test/CodeGen/offsetof.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CodeGen/offsetof.c')
-rw-r--r--clang/test/CodeGen/offsetof.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/test/CodeGen/offsetof.c b/clang/test/CodeGen/offsetof.c
index c279e22..13b34ea 100644
--- a/clang/test/CodeGen/offsetof.c
+++ b/clang/test/CodeGen/offsetof.c
@@ -10,3 +10,7 @@ int test(int len) {
return __builtin_offsetof(struct sockaddr_un, sun_path[len+1]);
}
+// Ensure we can form the offset to a structure defined in the first argument
+// without crashing or asserting on an invalid declaration (because the
+// declaration is actually valid).
+void c() { __builtin_offsetof(struct {int b;}, b); }