summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/tentative-decls.c
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-04-15 22:08:45 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-04-15 22:08:45 +0000
commit7dd749e6fd4c16db46ce1175aee607c55b79656e (patch)
tree2375116485686775926b9f5761b5c4369d9a8023 /clang/test/CodeGen/tentative-decls.c
parent455b8f41069ca322ede92f15f72ecaf4685f13f5 (diff)
downloadbcm5719-llvm-7dd749e6fd4c16db46ce1175aee607c55b79656e.tar.gz
bcm5719-llvm-7dd749e6fd4c16db46ce1175aee607c55b79656e.zip
Defer generation of tentative definitions.
- PR3980. - <rdar://problem/6762287> [irgen] crash when generating tentative definition of incomplete structure - This also avoids creating common definitions for things which are later overwritten. - XFAIL'ed external-defs.c, it isn't completing types properly yet. llvm-svn: 69231
Diffstat (limited to 'clang/test/CodeGen/tentative-decls.c')
-rw-r--r--clang/test/CodeGen/tentative-decls.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/clang/test/CodeGen/tentative-decls.c b/clang/test/CodeGen/tentative-decls.c
new file mode 100644
index 00000000000..4604f2f4297
--- /dev/null
+++ b/clang/test/CodeGen/tentative-decls.c
@@ -0,0 +1,28 @@
+// RUN: clang-cc -emit-llvm -o %t %s &&
+
+// RUN: grep '@r = common global \[1 x .*\] zeroinitializer' %t &&
+
+int r[];
+int (*a)[] = &r;
+
+struct s0;
+struct s0 x;
+// RUN: grep '@x = common global .struct.s0 zeroinitializer' %t &&
+
+struct s0 y;
+// RUN: grep '@y = common global .struct.s0 zeroinitializer' %t &&
+struct s0 *f0() {
+ return &y;
+}
+
+struct s0 {
+ int x;
+};
+
+// RUN: grep '@b = common global \[1 x .*\] zeroinitializer' %t &&
+int b[];
+int *f1() {
+ return b;
+}
+
+// RUN: true
OpenPOWER on IntegriCloud