diff options
| author | Eric Christopher <echristo@apple.com> | 2011-08-19 23:41:35 +0000 |
|---|---|---|
| committer | Eric Christopher <echristo@apple.com> | 2011-08-19 23:41:35 +0000 |
| commit | 3bf8310d42bad4dd2c49502f61caeb3cac376235 (patch) | |
| tree | f4a326f43d156b764528f649eadc160485d32fa7 /clang/test/CodeGenCXX/2005-02-11-AnonymousUnion.cpp | |
| parent | 7d4cee4b0269ef03a016d51a46819cce6a56a4d5 (diff) | |
| download | bcm5719-llvm-3bf8310d42bad4dd2c49502f61caeb3cac376235.tar.gz bcm5719-llvm-3bf8310d42bad4dd2c49502f61caeb3cac376235.zip | |
Migrate, FileCheckize and update:
2005-02-11-AnonymousUnion.cpp
2005-02-13-BadDynamicInit.cpp
2005-02-14-BitFieldOffset.cpp
2005-02-19-BitfieldStructCrash.cpp
2005-02-19-UnnamedVirtualThunkArgument.cpp
2005-02-20-BrokenReferenceTest.cpp
2006-03-01-GimplifyCrash.cpp
2006-03-06-C++RecurseCrash.cpp
2006-09-12-OpaqueStructCrash.cpp
2006-10-30-ClassBitfield.cpp
2006-11-20-GlobalSymbols.cpp
2006-11-20-GlobalSymbols.ll
2006-11-30-ConstantExprCrash.cpp
from llvm/test/FrontendC++.
llvm-svn: 138148
Diffstat (limited to 'clang/test/CodeGenCXX/2005-02-11-AnonymousUnion.cpp')
| -rw-r--r-- | clang/test/CodeGenCXX/2005-02-11-AnonymousUnion.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/2005-02-11-AnonymousUnion.cpp b/clang/test/CodeGenCXX/2005-02-11-AnonymousUnion.cpp new file mode 100644 index 00000000000..dee58173605 --- /dev/null +++ b/clang/test/CodeGenCXX/2005-02-11-AnonymousUnion.cpp @@ -0,0 +1,32 @@ +// RUN: %clang_cc1 %s -emit-llvm -o - + +// Test anonymous union with members of the same size. +int test1(float F) { + union { + float G; + int i; + }; + G = F; + return i; +} + +// test anonymous union with members of differing size. +int test2(short F) { + volatile union { + short G; + int i; + }; + G = F; + return i; +} + +// Make sure that normal unions work. duh :) +volatile union U_t { + short S; + int i; +} U; + +int test3(short s) { + U.S = s; + return U.i; +} |

