diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-06-05 11:06:16 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-05 11:06:16 -0700 |
commit | c0389c3c7a77187c36ebeffc63bc5e6e43a0d11a (patch) | |
tree | c37bbd5c42b6138cf723eef74cf4b4732b94ff82 /bindgen-integration/cpp/Test.cc | |
parent | 8a0934763ead0e911b24bf685d052e79aeda5f95 (diff) | |
parent | 10106aa8a40f36477fdc9cd034d9a2eec2698318 (diff) |
Auto merge of #736 - emilio:bitfields-revamp, r=fitzgen
ir: Fix a bunch of bitfield correctness issues.
In particular, the "flush the allocation unit" logic is only valid for
ms_structs (that is, MSVC).
It's slightly annoying to have this different behavior, but it'd work just fine
if we'd turn that on for MSVC.
This patch doesn't do that, yet at least, and adds tests for all the weird
bitfield alignments around.
Fixes #726 (and another set of hidden issues by the old code).
Diffstat (limited to 'bindgen-integration/cpp/Test.cc')
-rw-r--r-- | bindgen-integration/cpp/Test.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/bindgen-integration/cpp/Test.cc b/bindgen-integration/cpp/Test.cc index 7b0ec4ad..9d91250c 100644 --- a/bindgen-integration/cpp/Test.cc +++ b/bindgen-integration/cpp/Test.cc @@ -56,4 +56,24 @@ Third::assert(int first, bool second, ItemKind third) kind == third; } +bool +Fourth::assert(MyEnum tag, unsigned long ptr) +{ + return this->tag == tag && this->ptr == ptr; +} + +bool +Date2::assert(unsigned short nWeekDay, + unsigned short nMonthDay, + unsigned short nMonth, + unsigned short nYear, + unsigned short byte) +{ + return this->nWeekDay == nWeekDay && + this->nMonthDay == nMonthDay && + this->nMonth == nMonth && + this->nYear == nYear && + this->byte == byte; +} + } // namespace bitfields |