Skip to content

Commit d9bc681

Browse files
committed
Add a swift test.
1 parent 0b1a9d1 commit d9bc681

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
SWIFT_SOURCES := main.swift
2+
SWIFTFLAGS_EXTRAS := -O
3+
4+
include Makefile.rules
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import lldb
2+
from lldbsuite.test.lldbtest import *
3+
from lldbsuite.test.decorators import *
4+
import lldbsuite.test.lldbutil as lldbutil
5+
import unittest2
6+
7+
8+
class SwiftAddressExpressionTest(TestBase):
9+
@swiftTest
10+
def test(self):
11+
"""Test that you can use register names in image lookup in a swift frame."""
12+
self.build()
13+
(target, process, thread, breakpoint) = lldbutil.run_to_source_breakpoint(self,
14+
"break here to check image lookup", lldb.SBFileSpec("main.swift"))
15+
# I don't want to be too specific in what we print for image lookup,
16+
# we're testing that the address expression for the pc worked.
17+
self.expect("image lookup -va $pc", substrs=["doSomething"])
18+
self.expect("image lookup -va $pc+4", substrs=["doSomething"])
19+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
func doSomething() {
2+
print("break here to check image lookup");
3+
print("I need another line of code here");
4+
}
5+
6+
doSomething()
7+

0 commit comments

Comments
 (0)