[Lldb-commits] [lldb] r175666 - Fix invalid TestBitfields case (thanks Filipe!), and xfail one case due to GCC compiler bug.

Daniel Malea daniel.malea at intel.com
Wed Feb 20 13:11:20 PST 2013

Author: dmalea
Date: Wed Feb 20 15:11:20 2013
New Revision: 175666

URL: http://llvm.org/viewvc/llvm-project?rev=175666&view=rev
Fix invalid TestBitfields case (thanks Filipe!), and xfail one case due to GCC compiler bug.

Turns out unnamed bit fields should not be accessed ever in C (C99 section 4.7.8) or C++
(C++11 section 9.6). 

Unrelated to the above, this commit marks TestBitfields as expected-to-fail with GCC as 4.7
has problems with padding... the size of the struct with a uint32_t member is reported as 12
when GCC is used. Clang emits correct code.

Parts of this patch prepared by Filipe Cabecinhas!


Modified: lldb/trunk/test/lang/c/bitfields/TestBitfields.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/bitfields/TestBitfields.py?rev=175666&r1=175665&r2=175666&view=diff
--- lldb/trunk/test/lang/c/bitfields/TestBitfields.py (original)
+++ lldb/trunk/test/lang/c/bitfields/TestBitfields.py Wed Feb 20 15:11:20 2013
@@ -25,7 +25,6 @@ class BitfieldsTestCase(TestBase):
-    @expectedFailureLinux # PR-15260: lldb on Linux does not display the correct value of 1-bit fields in a struct
     def test_with_dwarf_and_run_command(self):
         """Test 'frame variable ...' on a variable with bitfields."""
@@ -34,6 +33,7 @@ class BitfieldsTestCase(TestBase):
+    @expectedFailureGcc # GCC (4.6/4.7) generates incorrect code with unnamed bitfields.
     def test_with_dwarf_and_python_api(self):
         """Use Python APIs to inspect a bitfields variable."""
@@ -106,7 +106,6 @@ class BitfieldsTestCase(TestBase):
         self.expect("frame variable --show-types more_bits", VARIABLES_DISPLAYED_CORRECTLY,
             substrs = ['(uint32_t:3) a = 3',
-                       '(int:1)  = 0',
                        '(uint8_t:1) b = \'\\0\'',
                        '(uint8_t:1) c = \'\\x01\'',
                        '(uint8_t:1) d = \'\\0\''])

More information about the lldb-commits mailing list