File: TestSwiftOtherArchDylib.py

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (39 lines) | stat: -rw-r--r-- 1,479 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import lldb
from lldbsuite.test.lldbtest import *
from lldbsuite.test.decorators import *
import lldbsuite.test.lldbutil as lldbutil
import os
import unittest2


class TestSwiftOtherArchDylib(TestBase):

    NO_DEBUG_INFO_TESTCASE = True

    @swiftTest
    @skipUnlessDarwin
    @skipIfDarwinEmbedded
    @skipIf(archs=no_match(["arm64"]))
    @expectedFailure("the swift.org toolchain cannot produce arm64e binaries")
    def test(self):
        """Test module import from dylibs with an architecture
           that uses a different SDK"""
        self.build()
        target, process, thread, bkpt = lldbutil.run_to_name_breakpoint(
            self, "foo", extra_images=['OtherArch.framework/OtherArch'])
        types_log = self.getBuildArtifact('types.log')
        self.expect("log enable lldb types -f "+ types_log)

        self.expect("expression 1", substrs=['1'])
        frame = thread.frames[0]
        while 'OtherArch.foo' not in frame.name:
            frame = frame.parent
            self.assertIsNotNone(frame)
        thread.SetSelectedFrame(frame.idx)
        self.expect("expression 1", substrs=['1'])

        # Check the types log.
        self.filecheck('platform shell cat "%s"' % types_log, __file__)
        # CHECK: SwiftASTContextForExpressions::LogConfiguration() arm64-apple-macosx
        # CHECK: Enabling per-module Swift scratch context
        # CHECK: {{SwiftASTContextForExpressions..OtherArch..}}::LogConfiguration() arm64e-apple-macosx