[Lldb-commits] [PATCH] [TestBitfields] Correct the attribute name to "aligned" in the testcase.
Siva Chandra
sivachandra at google.com
Tue Apr 7 10:51:20 PDT 2015
Hi clayborg, vharron,
This makes all parts of the test pass with Clang and GCC. They are
enabled with this patch.
http://reviews.llvm.org/D8874
Files:
test/lang/c/bitfields/TestBitfields.py
test/lang/c/bitfields/main.c
Index: test/lang/c/bitfields/TestBitfields.py
===================================================================
--- test/lang/c/bitfields/TestBitfields.py
+++ test/lang/c/bitfields/TestBitfields.py
@@ -35,7 +35,6 @@
@python_api_test
@dwarf_test
@skipIfWindows # BitFields exhibit crashes in record layout on Windows (http://llvm.org/pr21800)
- @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()
@@ -155,11 +154,7 @@
self.assertTrue(bits.GetTypeName() == 'Bits', "bits.GetTypeName() == 'Bits'");
self.assertTrue(bits.GetNumChildren() == 10, "bits.GetNumChildren() == 10");
test_compiler = self.getCompiler()
- if "gcc" in test_compiler:
- # Clang ignores the align attribute, so this structure isn't padded out to
- # 32 bytes there as the test author intended. Suppress this test for clang
- # till somebody has a chance to go rewrite the test source to be this big portably.
- self.assertTrue(bits.GetByteSize() == 32, "bits.GetByteSize() == 32");
+ self.assertTrue(bits.GetByteSize() == 32, "bits.GetByteSize() == 32");
# Notice the pattern of int(b1.GetValue(), 0). We pass a base of 0
# so that the proper radix is determined based on the contents of the
Index: test/lang/c/bitfields/main.c
===================================================================
--- test/lang/c/bitfields/main.c
+++ test/lang/c/bitfields/main.c
@@ -18,7 +18,7 @@
: 2, // Unnamed bitfield
b3 : 3,
: 2, // Unnamed bitfield (this will get removed)
- b4 __attribute__ ((align(16))),
+ b4 __attribute__ ((aligned(16))),
b5 : 5,
b6 : 6,
b7 : 7,
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8874.23352.patch
Type: text/x-patch
Size: 1975 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150407/6af5f340/attachment.bin>
More information about the lldb-commits
mailing list