diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2010-12-29 23:02:58 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2010-12-29 23:02:58 +0000 |
commit | 7bcde197d75fa40c982e47668dcfac2258f55296 (patch) | |
tree | f737e4e7b078668feef9af9665d6357bc9fda373 /clang/test | |
parent | bd530a8e83c9903a74b1e538fdfb3bf91a07afa0 (diff) | |
download | bcm5719-llvm-7bcde197d75fa40c982e47668dcfac2258f55296.tar.gz bcm5719-llvm-7bcde197d75fa40c982e47668dcfac2258f55296.zip |
Fix PR8796.
The problem was that we were asserting the we never added an empty class
to the same offset twice. This is not true for unions, where two members, empty
or not, can have the some offset.
llvm-svn: 122633
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/CodeGenCXX/empty-classes.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/empty-classes.cpp b/clang/test/CodeGenCXX/empty-classes.cpp index 59124e3d55b..1ce1dad40ff 100644 --- a/clang/test/CodeGenCXX/empty-classes.cpp +++ b/clang/test/CodeGenCXX/empty-classes.cpp @@ -53,6 +53,19 @@ int f() { return 0; } +namespace PR8796 { + struct FreeCell { + }; + union ThingOrCell { + FreeCell t; + FreeCell cell; + }; + struct Things { + ThingOrCell things; + }; + Things x; +} + #ifdef HARNESS extern "C" void printf(const char *, ...); |