Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,6 @@ do {
if (needs_object_ptr || static_method) {
const char *func_decorator = "";
if (static_method) {
if (is_class)
func_decorator = "final class";
else
func_decorator = "static";
} else if (is_class && !weak_self) {
func_decorator = "final";
Expand Down
3 changes: 3 additions & 0 deletions lldb/test/API/lang/swift/expression/actor/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SWIFT_SOURCES := main.swift

include Makefile.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import lldb
from lldbsuite.test.lldbtest import *
from lldbsuite.test.decorators import *
import lldbsuite.test.lldbutil as lldbutil
import os


class TestSwiftExpressionActor(TestBase):
@swiftTest
def test_static_func(self):
self.build()
lldbutil.run_to_source_breakpoint(
self, "break here for static", lldb.SBFileSpec("main.swift")
)

self.expect("expr self", substrs=["A.Type"])

@swiftTest
def test_func(self):
self.build()
lldbutil.run_to_source_breakpoint(
self, "break here for func", lldb.SBFileSpec("main.swift")
)

self.expect("expr self", substrs=["(a.A)", "i = 42", 's = "Hello"'])
14 changes: 14 additions & 0 deletions lldb/test/API/lang/swift/expression/actor/main.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
actor A {
let i = 42
let s = "Hello"
static func foo() {
print("break here for static")
}

func bar() {
print("break here for func")
}
}

A.foo()
await A().bar()
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ def test_expressions_in_class_functions(self):

self.assertTrue(len(threads) == 1)
lldbutil.check_expression(self, self.frame(), "i", str(i), False)
if i == 4:
self.expect('e self', substrs=['F<Int>.Type'])
if i == 6:
lldbutil.check_expression(self, self.frame(), "self", "a.H<Int>")
frame = threads[0].GetFrameAtIndex(0)
Expand Down