13e66bd29SRaphael Isemannimport lldb
23e66bd29SRaphael Isemannfrom lldbsuite.test.decorators import *
33e66bd29SRaphael Isemannfrom lldbsuite.test.lldbtest import *
43e66bd29SRaphael Isemannfrom lldbsuite.test import lldbutil
53e66bd29SRaphael Isemann
63e66bd29SRaphael Isemannclass TestCase(TestBase):
73e66bd29SRaphael Isemann
83e66bd29SRaphael Isemann    @no_debug_info_test
9*6331c7d0SRaphael Isemann    @skipIfWindows
103e66bd29SRaphael Isemann    def test(self):
113e66bd29SRaphael Isemann        self.build()
123e66bd29SRaphael Isemann        lldbutil.run_to_source_breakpoint(self, "// break here", lldb.SBFileSpec("main.c"))
133e66bd29SRaphael Isemann
143e66bd29SRaphael Isemann        self.expect_expr("complex_float", result_type="_Complex float", result_value="-1.5 + -2.5i")
153e66bd29SRaphael Isemann        self.expect_expr("complex_float + (2.0f + 3.5fi)", result_type="_Complex float", result_value="0.5 + 1i")
163e66bd29SRaphael Isemann
173e66bd29SRaphael Isemann        self.expect_expr("complex_double", result_type="_Complex double", result_value="-1.5 + -2.5i")
183e66bd29SRaphael Isemann        self.expect_expr("complex_double + (2.0 + 3.5i)", result_type="_Complex double", result_value="0.5 + 1i")
193e66bd29SRaphael Isemann
203e66bd29SRaphael Isemann    @no_debug_info_test
213e66bd29SRaphael Isemann    # FIXME: LLDB fails to read the imaginary part of the number.
223e66bd29SRaphael Isemann    @expectedFailureAll()
23*6331c7d0SRaphael Isemann    @skipIfWindows
243e66bd29SRaphael Isemann    def test_long_double(self):
253e66bd29SRaphael Isemann        self.build()
263e66bd29SRaphael Isemann        lldbutil.run_to_source_breakpoint(self, "// break here", lldb.SBFileSpec("main.c"))
273e66bd29SRaphael Isemann
283e66bd29SRaphael Isemann        self.expect_expr("complex_long_double", result_type="_Complex long double", result_value="-1.5 + 1i")
293e66bd29SRaphael Isemann        self.expect_expr("complex_long_double + (2.0L + 3.5Li)", result_type="_Complex long double", result_value="0.5 + 1i")
30