diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2008-06-08 01:23:18 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2008-06-08 01:23:18 +0000 |
commit | c98a7add43b61ec7d0e87ec2b1f30596af6515d0 (patch) | |
tree | b49c6f73ebb8c1dd6a7574fa73b0b58a314a1d21 /clang/test | |
parent | 69d721e07144a9808304709cc7b4ef216a70ebb1 (diff) | |
download | bcm5719-llvm-c98a7add43b61ec7d0e87ec2b1f30596af6515d0.tar.gz bcm5719-llvm-c98a7add43b61ec7d0e87ec2b1f30596af6515d0.zip |
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
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/CodeGen/static-local-union.c | 4 |
1 files changed, 4 insertions, 0 deletions
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;} + |