2 Tests GCC's complex integer types.
6 from lldbsuite
.test
.decorators
import *
7 from lldbsuite
.test
.lldbtest
import *
8 from lldbsuite
.test
import lldbutil
11 class TestCase(TestBase
):
16 lldbutil
.run_to_source_breakpoint(
17 self
, "// break here", lldb
.SBFileSpec("main.c")
20 long_size_eq_int
= self
.frame().EvaluateExpression(
21 "sizeof(long) == sizeof(int)"
24 # FIXME: LLDB treats all complex ints as unsigned, so the value is wrong.
27 result_type
="_Complex int",
28 result_value
="4294967295 + 4294967294i",
31 "complex_unsigned", result_type
="_Complex int", result_value
="1 + 2i"
34 # FIXME: We get the type wrong if long has the same size as int.
35 if long_size_eq_int
.GetValue() == "true":
36 self
.expect_expr("complex_long", result_type
="_Complex int")
38 "complex_unsigned_long",
39 result_type
="_Complex int",
40 result_value
="1 + 2i",
43 self
.expect_expr("complex_long", result_type
="_Complex long")
45 "complex_unsigned_long",
46 result_type
="_Complex long",
47 result_value
="1 + 2i",
52 def test_long_long(self
):
54 lldbutil
.run_to_source_breakpoint(
55 self
, "// break here", lldb
.SBFileSpec("main.c")
58 # FIXME: We get the type wrong if long has the same size as long long.
59 # FIXME: LLDB treats all complex ints as unsigned, so the value is wrong.
60 long_size_eq_long_long
= self
.frame().EvaluateExpression(
61 "sizeof(long) == sizeof(long long)"
63 if long_size_eq_long_long
.GetValue() == "true":
64 self
.expect_expr("complex_long_long", result_type
="_Complex long")
66 "complex_unsigned_long_long",
67 result_type
="_Complex long",
68 result_value
="1 + 2i",
71 self
.expect_expr("complex_long_long", result_type
="_Complex long long")
73 "complex_unsigned_long_long",
74 result_type
="_Complex long long",
75 result_value
="1 + 2i",