aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/const-init.c
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2008-11-22 06:42:54 +0000
committerAnders Carlsson <andersca@mac.com>2008-11-22 06:42:54 +0000
commitcd761cd1a73510f4577fa00d9a6ce15090a0a135 (patch)
tree9cf751dd5b60fcaed682a0bab8e13ff56b95aa9e /test/CodeGen/const-init.c
parent9efe9709287801562a3cbe1e5f3ab5dd8175c25b (diff)
Add test for PR2992.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59861 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/const-init.c')
-rw-r--r--test/CodeGen/const-init.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/CodeGen/const-init.c b/test/CodeGen/const-init.c
index 0efab6f903..bded2e0a3f 100644
--- a/test/CodeGen/const-init.c
+++ b/test/CodeGen/const-init.c
@@ -13,3 +13,11 @@ void *d = c;
intptr_t e = c; // expected-warning {{incompatible pointer to integer conversion}}
int f, *g = __extension__ &f, *h = (1 != 1) ? &f : &f;
+
+union s2 {
+ struct {
+ struct { } *f0;
+ } f0;
+};
+
+int g0 = (int)(&(((union s2 *) 0)->f0.f0) - 0);