Skip to content

Commit a3a4448

Browse files
authored
Merge pull request #9447 from augusto2112/test-big-mpe
[lldb][NFC] Add a test for big multi payload enums
2 parents cc3ddbf + f4666d3 commit a3a4448

File tree

3 files changed

+87
-0
lines changed

3 files changed

+87
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
SWIFT_SOURCES := main.swift
2+
include Makefile.rules
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import lldb
2+
from lldbsuite.test.lldbtest import *
3+
from lldbsuite.test.decorators import *
4+
import lldbsuite.test.lldbutil as lldbutil
5+
6+
7+
class TestSwiftBigMultiPayloadEnum(TestBase):
8+
@swiftTest
9+
def test(self):
10+
self.build()
11+
lldbutil.run_to_source_breakpoint(
12+
self, "break here", lldb.SBFileSpec("main.swift")
13+
)
14+
15+
a1 = self.frame().FindVariable("a1")
16+
lldbutil.check_variable(self, a1, False, typename="a.Request", value="a1")
17+
18+
a2 = self.frame().FindVariable("a2")
19+
lldbutil.check_variable(self, a2, False, typename="a.Request", value="a2")
20+
21+
a3 = self.frame().FindVariable("a3")
22+
lldbutil.check_variable(self, a3, False, typename="a.Request", value="a3")
23+
24+
a4 = self.frame().FindVariable("a4")
25+
lldbutil.check_variable(self, a4, False, typename="a.Request", value="a4")
26+
27+
a5 = self.frame().FindVariable("a5")
28+
lldbutil.check_variable(self, a5, False, typename="a.Request", value="a5")
29+
30+
a6_item1 = self.frame().FindVariable("a6_item1")
31+
lldbutil.check_variable(self, a6_item1, False, typename="a.Request", value="a6")
32+
33+
item1 = a6_item1.GetChildAtIndex(0)
34+
lldbutil.check_variable(self, item1, False, typename="a.A6", value="item1")
35+
36+
a6_item2 = self.frame().FindVariable("a6_item2")
37+
lldbutil.check_variable(self, a6_item2, False, typename="a.Request", value="a6")
38+
39+
item2 = a6_item2.GetChildAtIndex(0)
40+
lldbutil.check_variable(self, item2, False, typename="a.A6", value="item2")
41+
42+
a7_item1 = self.frame().FindVariable("a7_item1")
43+
lldbutil.check_variable(self, a7_item1, False, typename="a.Request", value="a7")
44+
45+
item1 = a7_item1.GetChildAtIndex(0)
46+
lldbutil.check_variable(self, item1, False, typename="a.A7", value="item1")
47+
48+
a7_item2 = self.frame().FindVariable("a7_item2")
49+
lldbutil.check_variable(self, a7_item2, False, typename="a.Request", value="a7")
50+
51+
item2 = a7_item2.GetChildAtIndex(0)
52+
lldbutil.check_variable(self, item2, False, typename="a.A7", value="item2")
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
public enum A6 {
2+
case item1
3+
case item2
4+
}
5+
public enum A7 {
6+
case item1
7+
case item2
8+
}
9+
10+
public enum Request {
11+
case a1
12+
case a2
13+
case a3
14+
case a4
15+
case a5
16+
case a6(A6)
17+
case a7(A7)
18+
}
19+
20+
func f() {
21+
let a1 = Request.a1
22+
let a2 = Request.a2
23+
let a3 = Request.a3
24+
let a4 = Request.a4
25+
let a5 = Request.a5
26+
let a6_item1 = Request.a6(.item1)
27+
let a6_item2 = Request.a6(.item2)
28+
let a7_item1 = Request.a7(.item1)
29+
let a7_item2 = Request.a7(.item2)
30+
print("break here")
31+
}
32+
33+
f()

0 commit comments

Comments
 (0)