From c98a7add43b61ec7d0e87ec2b1f30596af6515d0 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Sun, 8 Jun 2008 01:23:18 +0000 Subject: Don't crash emitting an initializer for a static local with union type. This fix just makes sure to construct the global with the appropriate type, and fixes up the one user this affects to compensate. llvm-svn: 52084 --- clang/test/CodeGen/static-local-union.c | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 clang/test/CodeGen/static-local-union.c (limited to 'clang/test') diff --git a/clang/test/CodeGen/static-local-union.c b/clang/test/CodeGen/static-local-union.c new file mode 100644 index 00000000000..9515a316d62 --- /dev/null +++ b/clang/test/CodeGen/static-local-union.c @@ -0,0 +1,4 @@ +// RUN: clang -emit-llvm < %s + +int a() {static union{int a;} r[2] = {1,2};return r[1].a;} + -- cgit v1.2.3