aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/func-decl-cleanup.c
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2008-05-27 05:07:37 +0000
committerEli Friedman <eli.friedman@gmail.com>2008-05-27 05:07:37 +0000
commit2742496d75ecb733c07c65c9a35cbfaa88ca81e4 (patch)
treefc97fc62d8afa7c10a1d7eff744df97b1f8a0a3e /test/CodeGen/func-decl-cleanup.c
parent6f7e2eee917a136ffc36834f020782b3f15d8fa6 (diff)
Don't swap function decls, and add them to the scope as they are
encountered. Mixing up the decls is unintuitive, and confuses the AST destruction code. Fixes PR2360. Note that there is a need to look up the characteristics and declarations of a function associated with a particular name or decl, but the original swapping code doesn't solve it properly. http://lists.cs.uiuc.edu/pipermail/cfe-dev/2008-May/001644.html is one suggestion for how to fix that. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51584 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/func-decl-cleanup.c')
-rw-r--r--test/CodeGen/func-decl-cleanup.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/CodeGen/func-decl-cleanup.c b/test/CodeGen/func-decl-cleanup.c
new file mode 100644
index 0000000000..fa1e3d69b1
--- /dev/null
+++ b/test/CodeGen/func-decl-cleanup.c
@@ -0,0 +1,12 @@
+// RUN: clang %s -emit-llvm -o -
+
+
+// PR2360
+typedef void fn_t();
+
+fn_t a,b;
+
+void b()
+{
+}
+