[mlir][acc] Introduce MappableType interface (#122146)
[llvm-project.git] / lldb / test / API / lang / objc / modules-non-objc-target / TestObjCModulesNonObjCTarget.py
blob7e6728ca78d1592bcf303e9d3a115a62f159cdcc
1 """
2 Tests that importing ObjC modules in a non-ObjC target doesn't crash LLDB.
3 """
5 import lldb
6 from lldbsuite.test.decorators import *
7 from lldbsuite.test.lldbtest import *
8 from lldbsuite.test import lldbutil
11 class TestCase(TestBase):
12 def test(self):
13 self.build()
14 lldbutil.run_to_source_breakpoint(
15 self, "// break here", lldb.SBFileSpec("main.c")
18 # Import foundation to get some ObjC types.
19 self.expect("expr --lang objc -- @import Foundation")
20 # Do something with NSString (which requires special handling when
21 # preparing to run in the target). The expression most likely can't
22 # be prepared to run in the target but it should at least not crash LLDB.
23 self.expect(
24 'expr --lang objc -- [NSString stringWithFormat:@"%d", 1];',
25 error=True,
26 substrs=[
27 "Rewriting an Objective-C constant string requires CFStringCreateWithBytes"