Files
clang-p2996/lldb/test/API/lang/objc/orderedset/TestOrderedSet.py
Jonas Devlieghere 9d5e95d094 Re-land "[lldb] Upstream support for Foundation constant classes"
Upstream support for NSConstantArray, NSConstantIntegerNumber,
NSConstant{Float,Double}Number and NSConstantDictionary.

We would've upstreamed this earlier but testing it requires
-fno-constant-nsnumber-literals, -fno-constant-nsarray-literals and
-fno-constant-nsdictionary-literals which haven't been upstreamed yet.
As a temporary workaround use the system compiler (xcrun clang) for the
constant variant of the tests.

I'm just upstreaming this. The patch and the tests were all authored by
Fred Riss.

Differential revision: https://reviews.llvm.org/D107660
2021-08-06 17:24:47 -07:00

34 lines
1.1 KiB
Python

import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestOrderedSet(TestBase):
mydir = TestBase.compute_mydir(__file__)
def test_ordered_set(self):
self.build()
self.run_tests()
@skipUnlessDarwin
def test_ordered_set_no_const(self):
disable_constant_classes = {
'CC':
'xcrun clang', # FIXME: Remove when flags are available upstream.
'CFLAGS_EXTRAS':
'-fno-constant-nsnumber-literals ' +
'-fno-constant-nsarray-literals ' +
'-fno-constant-nsdictionary-literals'
}
self.build(dictionary=disable_constant_classes)
self.run_tests()
def run_tests(self):
src_file = "main.m"
src_file_spec = lldb.SBFileSpec(src_file)
(target, process, thread, main_breakpoint) = lldbutil.run_to_source_breakpoint(self,
"break here", src_file_spec, exe_name = "a.out")
frame = thread.GetSelectedFrame()
self.expect("expr -d run -- orderedSet", substrs=["3 elements"])
self.expect("expr -d run -- *orderedSet", substrs=["(int)1", "(int)2", "(int)3"])