summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-02-25 20:08:33 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-02-25 20:08:33 +0000
commit1cdbc5404b408dfe241392dc9c2d25bece69178d (patch)
treec95739ba47416a7e3e56cf9143c1c2adc1f00349 /clang/test
parent441f24118a292e1c8052cf0f4308749cef9968cc (diff)
downloadbcm5719-llvm-1cdbc5404b408dfe241392dc9c2d25bece69178d.tar.gz
bcm5719-llvm-1cdbc5404b408dfe241392dc9c2d25bece69178d.zip
Allow constant initializers to reference their defining decl.
- PR3662. llvm-svn: 65472
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CodeGen/const-init.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/CodeGen/const-init.c b/clang/test/CodeGen/const-init.c
index f6199815edc..d88add36a92 100644
--- a/clang/test/CodeGen/const-init.c
+++ b/clang/test/CodeGen/const-init.c
@@ -85,4 +85,15 @@ void g18(void) {
static int *p[] = { &g19 };
}
+// RUN: grep '@g20.l0 = internal global .struct.g20_s1 <{ .struct.g20_s0\* null, .struct.g20_s0\*\* getelementptr (.struct.g20_s1\* @g20.l0, i32 0, i32 0) }>' %t &&
+
+struct g20_s0;
+struct g20_s1 {
+ struct g20_s0 *f0, **f1;
+};
+void *g20(void) {
+ static struct g20_s1 l0 = { ((void*) 0), &l0.f0 };
+ return l0.f1;
+}
+
// RUN: true
OpenPOWER on IntegriCloud