From cd761cd1a73510f4577fa00d9a6ce15090a0a135 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Sat, 22 Nov 2008 06:42:54 +0000 Subject: [PATCH] Add test for PR2992. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59861 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/const-init.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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); -- 2.40.0