diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2009-04-15 22:08:45 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2009-04-15 22:08:45 +0000 |
| commit | 7dd749e6fd4c16db46ce1175aee607c55b79656e (patch) | |
| tree | 2375116485686775926b9f5761b5c4369d9a8023 /clang/test | |
| parent | 455b8f41069ca322ede92f15f72ecaf4685f13f5 (diff) | |
| download | bcm5719-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')
| -rw-r--r-- | clang/test/CodeGen/tentative-array.c | 4 | ||||
| -rw-r--r-- | clang/test/CodeGen/tentative-decls.c | 28 | ||||
| -rw-r--r-- | clang/test/PCH/external-defs.c | 2 |
3 files changed, 30 insertions, 4 deletions
diff --git a/clang/test/CodeGen/tentative-array.c b/clang/test/CodeGen/tentative-array.c deleted file mode 100644 index 6879d0f07d7..00000000000 --- a/clang/test/CodeGen/tentative-array.c +++ /dev/null @@ -1,4 +0,0 @@ -// RUN: clang-cc -emit-llvm < %s -triple=i686-apple-darwin9 | grep "global \[1 x i32\]" - -int r[]; -int (*a)[] = &r; 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 diff --git a/clang/test/PCH/external-defs.c b/clang/test/PCH/external-defs.c index 6a46f45cc1e..251a10d9ce6 100644 --- a/clang/test/PCH/external-defs.c +++ b/clang/test/PCH/external-defs.c @@ -19,3 +19,5 @@ int incomplete_array3[]; struct S { int x, y; }; + +// XFAIL |

