From c6a70063cb93d536160c3c48ecea003ebef0f52a Mon Sep 17 00:00:00 2001 From: Daniel Malea Date: Wed, 20 Feb 2013 21:11:20 +0000 Subject: [PATCH] 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! llvm-svn: 175666 --- lldb/test/lang/c/bitfields/TestBitfields.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lldb/test/lang/c/bitfields/TestBitfields.py b/lldb/test/lang/c/bitfields/TestBitfields.py index 489dc86..50dabd1 100644 --- a/lldb/test/lang/c/bitfields/TestBitfields.py +++ b/lldb/test/lang/c/bitfields/TestBitfields.py @@ -25,7 +25,6 @@ class BitfieldsTestCase(TestBase): self.buildDsym() self.bitfields_variable_python() - @expectedFailureLinux # PR-15260: lldb on Linux does not display the correct value of 1-bit fields in a struct @dwarf_test def test_with_dwarf_and_run_command(self): """Test 'frame variable ...' on a variable with bitfields.""" @@ -34,6 +33,7 @@ class BitfieldsTestCase(TestBase): @python_api_test @dwarf_test + @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.""" self.buildDwarf() @@ -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\'']) -- 2.7.4