1*3e66bd29SRaphael Isemannimport lldb
2*3e66bd29SRaphael Isemannfrom lldbsuite.test.decorators import *
3*3e66bd29SRaphael Isemannfrom lldbsuite.test.lldbtest import *
4*3e66bd29SRaphael Isemannfrom lldbsuite.test import lldbutil
5*3e66bd29SRaphael Isemann
6*3e66bd29SRaphael Isemannclass TestCase(TestBase):
7*3e66bd29SRaphael Isemann
8*3e66bd29SRaphael Isemann    mydir = TestBase.compute_mydir(__file__)
9*3e66bd29SRaphael Isemann
10*3e66bd29SRaphael Isemann    @no_debug_info_test
11*3e66bd29SRaphael Isemann    def test(self):
12*3e66bd29SRaphael Isemann        self.build()
13*3e66bd29SRaphael Isemann        lldbutil.run_to_source_breakpoint(self, "// break here", lldb.SBFileSpec("main.c"))
14*3e66bd29SRaphael Isemann
15*3e66bd29SRaphael Isemann        self.expect_expr("complex_float", result_type="_Complex float", result_value="-1.5 + -2.5i")
16*3e66bd29SRaphael Isemann        self.expect_expr("complex_float + (2.0f + 3.5fi)", result_type="_Complex float", result_value="0.5 + 1i")
17*3e66bd29SRaphael Isemann
18*3e66bd29SRaphael Isemann        self.expect_expr("complex_double", result_type="_Complex double", result_value="-1.5 + -2.5i")
19*3e66bd29SRaphael Isemann        self.expect_expr("complex_double + (2.0 + 3.5i)", result_type="_Complex double", result_value="0.5 + 1i")
20*3e66bd29SRaphael Isemann
21*3e66bd29SRaphael Isemann    @no_debug_info_test
22*3e66bd29SRaphael Isemann    # FIXME: LLDB fails to read the imaginary part of the number.
23*3e66bd29SRaphael Isemann    @expectedFailureAll()
24*3e66bd29SRaphael Isemann    def test_long_double(self):
25*3e66bd29SRaphael Isemann        self.build()
26*3e66bd29SRaphael Isemann        lldbutil.run_to_source_breakpoint(self, "// break here", lldb.SBFileSpec("main.c"))
27*3e66bd29SRaphael Isemann
28*3e66bd29SRaphael Isemann        self.expect_expr("complex_long_double", result_type="_Complex long double", result_value="-1.5 + 1i")
29*3e66bd29SRaphael Isemann        self.expect_expr("complex_long_double + (2.0L + 3.5Li)", result_type="_Complex long double", result_value="0.5 + 1i")
30