xref: /llvm-project/lldb/test/API/lang/objc/orderedset/TestOrderedSet.py (revision 44fc987ed174e32544a577387ab0df6886495e82)
199451b44SJordan Rupprechtimport lldb
299451b44SJordan Rupprechtfrom lldbsuite.test.decorators import *
399451b44SJordan Rupprechtfrom lldbsuite.test.lldbtest import *
499451b44SJordan Rupprechtfrom lldbsuite.test import lldbutil
599451b44SJordan Rupprecht
699451b44SJordan Rupprecht
72238dcc3SJonas Devlieghereclass TestOrderedSet(TestBase):
899451b44SJordan Rupprecht    def test_ordered_set(self):
999451b44SJordan Rupprecht        self.build()
109d5e95d0SJonas Devlieghere        self.run_tests()
119d5e95d0SJonas Devlieghere
129d5e95d0SJonas Devlieghere    @skipUnlessDarwin
139d5e95d0SJonas Devlieghere    def test_ordered_set_no_const(self):
149d5e95d0SJonas Devlieghere        disable_constant_classes = {
152238dcc3SJonas Devlieghere            "CFLAGS_EXTRAS": "-fno-constant-nsnumber-literals "
162238dcc3SJonas Devlieghere            + "-fno-constant-nsarray-literals "
172238dcc3SJonas Devlieghere            + "-fno-constant-nsdictionary-literals",
189d5e95d0SJonas Devlieghere        }
19*44fc987eSVladislav Dzhidzhoev        # FIXME: Remove when flags are available upstream.
20*44fc987eSVladislav Dzhidzhoev        self.build(dictionary=disable_constant_classes, compiler="xcrun clang")
219d5e95d0SJonas Devlieghere        self.run_tests()
229d5e95d0SJonas Devlieghere
239d5e95d0SJonas Devlieghere    def run_tests(self):
2499451b44SJordan Rupprecht        src_file = "main.m"
2599451b44SJordan Rupprecht        src_file_spec = lldb.SBFileSpec(src_file)
262238dcc3SJonas Devlieghere        (target, process, thread, main_breakpoint) = lldbutil.run_to_source_breakpoint(
272238dcc3SJonas Devlieghere            self, "break here", src_file_spec, exe_name="a.out"
282238dcc3SJonas Devlieghere        )
2999451b44SJordan Rupprecht        frame = thread.GetSelectedFrame()
3099451b44SJordan Rupprecht        self.expect("expr -d run -- orderedSet", substrs=["3 elements"])
312238dcc3SJonas Devlieghere        self.expect(
322238dcc3SJonas Devlieghere            "expr -d run -- *orderedSet", substrs=["(int)1", "(int)2", "(int)3"]
332238dcc3SJonas Devlieghere        )
34