File tree Expand file tree Collapse file tree 2 files changed +12
-39
lines changed
lldb/test/API/commands/expression/anonymous-struct Expand file tree Collapse file tree 2 files changed +12
-39
lines changed Original file line number Diff line number Diff line change 6
6
Ticket: https://llvm.org/bugs/show_bug.cgi?id=26790
7
7
"""
8
8
9
-
10
9
import lldb
11
10
12
11
from lldbsuite .test .decorators import *
13
12
from lldbsuite .test .lldbtest import *
14
13
from lldbsuite .test import lldbutil
15
14
16
-
17
15
class TestExprLookupAnonStructTypedef (TestBase ):
18
16
mydir = TestBase .compute_mydir (__file__ )
19
17
20
- def setUp (self ):
21
- TestBase .setUp (self )
22
- # Find the breakpoint
23
- self .line = line_number ('main.cpp' , '// lldb testsuite break' )
24
-
25
18
@expectedFailureAll (
26
19
oslist = ['linux' ],
27
20
archs = ['arm' ],
28
21
bugnumber = "llvm.org/pr27868" )
29
22
def test (self ):
30
23
"""Test typedeffed untagged struct arguments for function call expressions"""
31
24
self .build ()
32
-
33
- self .runCmd ("file " + self .getBuildArtifact ("a.out" ),
34
- CURRENT_EXECUTABLE_SET )
35
- lldbutil .run_break_set_by_file_and_line (
36
- self ,
37
- "main.cpp" ,
38
- self .line ,
39
- num_expected_locations = - 1 ,
40
- loc_exact = True
41
- )
42
-
43
- self .runCmd ("run" , RUN_SUCCEEDED )
25
+ lldbutil .run_to_source_breakpoint (self , "// break here" , lldb .SBFileSpec ("main.cpp" ))
44
26
self .expect_expr ("multiply(&s)" , result_type = "double" , result_value = "1" )
Original file line number Diff line number Diff line change 1
- #include < tgmath.h>
2
-
3
1
typedef struct {
4
- float f;
5
- int i;
2
+ float f;
3
+ int i;
6
4
} my_untagged_struct;
7
5
8
- double multiply (my_untagged_struct *s)
9
- {
10
- return s->f * s->i ;
11
- }
6
+ double multiply (my_untagged_struct *s) { return s->f * s->i ; }
12
7
13
- double multiply (my_untagged_struct *s, int x)
14
- {
15
- return multiply (s) * x;
16
- }
8
+ double multiply (my_untagged_struct *s, int x) { return multiply (s) * x; }
17
9
18
- int main (int argc, char **argv)
19
- {
20
- my_untagged_struct s = {
21
- .f = (float )argc,
22
- .i = argc,
23
- };
24
- // lldb testsuite break
25
- return !(multiply (&s, argc) == pow (argc, 3 ));
10
+ int main (int argc, char **argv) {
11
+ my_untagged_struct s = {
12
+ .f = (float )argc,
13
+ .i = argc,
14
+ };
15
+ // break here
16
+ return multiply (&s, argc) > 0 ;
26
17
}
You can’t perform that action at this time.
0 commit comments