Skip to content

Commit ea7e23c

Browse files
real-mikhailMikhail Zakharov
and
Mikhail Zakharov
authored
[lldb] Fixed TestProcessModificationIdOnExpr to work on both x86 and x64 architectures (#138941)
Original PR where test was introduced and improvements discussed: #129092 (comment) Co-authored-by: Mikhail Zakharov <[email protected]>
1 parent d178340 commit ea7e23c

File tree

1 file changed

+30
-12
lines changed

1 file changed

+30
-12
lines changed

lldb/test/Shell/Expr/TestProcessModificationIdOnExpr.cpp

+30-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Tests that ProcessModID.m_memory_id is not bumped when evaluating expressions without side effects.
22

3-
// REQUIRES: target-windows && target-x86
4-
// Due to different implementations exact numbers (m_stop_id) are different on different OSs. So we lock this test to specific platform (Windows). It is limited to x86 because on x86, running get()
3+
// REQUIRES: target-windows && (target-x86 || target-x86_64)
4+
// Due to different implementations exact numbers (m_stop_id) are different on different OSs. So we lock this test to specific platform (Windows). It is limited to x86/x64 because on x86/x64, running get()
55
// requires that we write the return address to the stack, this does not happen on AArch64.
66

77
// RUN: %build %s -o %t
@@ -11,10 +11,13 @@
1111
// RUN: -o "process status -d" \
1212
// RUN: -o "expr x.i != 42" \
1313
// RUN: -o "process status -d" \
14+
// RUN: -o "process status -d" \
1415
// RUN: -o "expr x.get()" \
1516
// RUN: -o "process status -d" \
17+
// RUN: -o "process status -d" \
1618
// RUN: -o "expr x.i = 10" \
1719
// RUN: -o "process status -d" \
20+
// RUN: -o "process status -d" \
1821
// RUN: -o "continue" \
1922
// RUN: -o "process status -d" \
2023
// RUN: -o "exit" | FileCheck %s -dump-input=fail
@@ -36,34 +39,49 @@ int main() {
3639
}
3740

3841
// CHECK-LABEL: process status -d
39-
// CHECK: m_stop_id: 2
40-
// CHECK: m_memory_id: 0
42+
// CHECK: m_stop_id: [[#STOP_ID:]]
43+
// CHECK: m_memory_id: [[#MEMORY_ID:]]
4144

4245
// CHECK-LABEL: expr x.i != 42
4346
// IDs are not changed when executing simple expressions
4447

4548
// CHECK-LABEL: process status -d
46-
// CHECK: m_stop_id: 2
47-
// CHECK: m_memory_id: 0
49+
// CHECK: m_stop_id: [[#STOP_ID]]
50+
// CHECK: m_memory_id: [[#MEMORY_ID]]
51+
52+
// CHECK-LABEL: process status -d
53+
// Remember new values
54+
// CHECK: m_stop_id: [[#STOP_ID:]]
55+
// CHECK: m_memory_id: [[#MEMORY_ID:]]
4856

4957
// CHECK-LABEL: expr x.get()
5058
// Expression causes ID to be bumped because LLDB has to execute function and in doing
5159
// so must write the return address to the stack.
5260

5361
// CHECK-LABEL: process status -d
54-
// CHECK: m_stop_id: 3
55-
// CHECK: m_memory_id: 1
62+
// CHECK-NOT: m_stop_id: [[#STOP_ID]]
63+
// CHECK-NOT: m_memory_id: [[#MEMORY_ID]]
64+
65+
// CHECK-LABEL: process status -d
66+
// Remember new values
67+
// CHECK: m_stop_id: [[#STOP_ID:]]
68+
// CHECK: m_memory_id: [[#MEMORY_ID:]]
5669

5770
// CHECK-LABEL: expr x.i = 10
5871
// Expression causes MemoryID to be bumped because LLDB writes to non-cache memory
5972

6073
// CHECK-LABEL: process status -d
61-
// CHECK: m_stop_id: 3
62-
// CHECK: m_memory_id: 2
74+
// CHECK: m_stop_id: [[#STOP_ID]]
75+
// CHECK-NOT: m_memory_id: [[#MEMORY_ID]]
76+
77+
// CHECK-LABEL: process status -d
78+
// Remember new values
79+
// CHECK: m_stop_id: [[#STOP_ID:]]
80+
// CHECK: m_memory_id: [[#MEMORY_ID:]]
6381

6482
// CHECK-LABEL: continue
6583
// Continue causes StopID to be bumped because process is resumed
6684

6785
// CHECK-LABEL: process status -d
68-
// CHECK: m_stop_id: 4
69-
// CHECK: m_memory_id: 2
86+
// CHECK-NOT: m_stop_id: [[#STOP_ID]]
87+
// CHECK: m_memory_id: [[#MEMORY_ID]]

0 commit comments

Comments
 (0)