Files
clang-p2996/lldb/test/API/lang/c/sizeof/TestCSizeof.py
Raphael Isemann 2ce889fa4e [lldb][NFC] Add size tests for empty records with alignment and with empty members
This came up during the Windows bot failure discussing after D105471 . See
also 3d9a9fa691 .
2021-08-30 16:38:13 +02:00

20 lines
729 B
Python

import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
def test(self):
self.build()
self.createTestTarget()
# Empty structs are not allowed in C, but Clang/GCC allow them and
# give them a size of 0.
self.expect_expr("sizeof(Empty) == sizeof_empty", result_value="true")
self.expect_expr("sizeof(EmptyMember) == sizeof_empty_member", result_value="true")
self.expect_expr("sizeof(SingleMember) == sizeof_single", result_value="true")
self.expect_expr("sizeof(PaddingMember) == sizeof_padding", result_value="true")