Skip to content

Commit 6ad2f0a

Browse files
committed
Update test to use 'target var' instead of 'frame var'. Move it to
the appropriate location.
1 parent b7b7b54 commit 6ad2f0a

File tree

5 files changed

+52
-85
lines changed

5 files changed

+52
-85
lines changed

lldb/test/API/commands/frame/var/anon-struct/TestFrameVarAnonStruct.py

Lines changed: 0 additions & 66 deletions
This file was deleted.

lldb/test/API/commands/frame/var/anon-struct/main.cpp

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
"""
2+
Test handling of Anonymous Structs, especially that they don't crash lldb.
3+
"""
4+
5+
6+
import lldb
7+
import lldbsuite.test.lldbutil as lldbutil
8+
from lldbsuite.test.decorators import *
9+
from lldbsuite.test.lldbtest import *
10+
import os
11+
import shutil
12+
import time
13+
14+
15+
class TestFrameVarAnonStruct(TestBase):
16+
# If your test case doesn't stress debug info, then
17+
# set this to true. That way it won't be run once for
18+
# each debug info format.
19+
NO_DEBUG_INFO_TESTCASE = True
20+
21+
def test_frame_var(self):
22+
self.build()
23+
self.do_test()
24+
25+
def do_test(self):
26+
target = self.createTestTarget()
27+
28+
# Verify that we don't crash in this case.
29+
self.expect(
30+
"target variable 'b.x'",
31+
error=True,
32+
substrs=["can't find global variable 'b.x'"],
33+
)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
struct A {
2+
struct {
3+
int x = 1;
4+
};
5+
int y = 2;
6+
} a;
7+
8+
struct B {
9+
// Anonymous struct inherits another struct.
10+
struct : public A {
11+
int z = 3;
12+
};
13+
int w = 4;
14+
A a;
15+
} b;
16+
17+
int main(int argc, char **argv) {
18+
return 0;
19+
}

0 commit comments

Comments
 (0)