]> granicus.if.org Git - clang/commitdiff
Add test for PR2992.
authorAnders Carlsson <andersca@mac.com>
Sat, 22 Nov 2008 06:42:54 +0000 (06:42 +0000)
committerAnders Carlsson <andersca@mac.com>
Sat, 22 Nov 2008 06:42:54 +0000 (06:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59861 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGen/const-init.c

index 0efab6f903676a2bf3bb95f2bb868d8e8a5b1ae6..bded2e0a3f6fcfac4bd7274f2fedaea46ee1f273 100644 (file)
@@ -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);