1 REQUIRES: target-windows, msvc
2 RUN: %build --compiler=msvc --nodefaultlib --output=%t.exe %S/Inputs/ExpressionsTest.cpp
3 RUN: not %lldb -b -s %S/Inputs/ExpressionsTest0.script -s %S/Inputs/ExpressionsTest1.script -s %S/Inputs/ExpressionsTest2.script -- %t.exe 2>&1 | FileCheck %s
5 // Check the variable value through `expression`
6 CHECK: (lldb) expression result
7 CHECK: (char) $0 = '\x1c'
9 // Call the function just like in the code
10 CHECK: (lldb) expression N0::N1::sum(N0::N1::buf1, sizeof(N0::N1::buf1))
11 CHECK: (char) $1 = '\x1c'
13 // Try the relaxed namespaces search
14 CHECK: (lldb) expression N1::sum(N1::buf1, sizeof(N1::buf1))
15 CHECK: (char) $2 = '\x1c'
17 // Try the relaxed variables and functions search
18 CHECK: (lldb) expression sum(buf1, sizeof(buf1))
19 CHECK: (char) $3 = '\x1c'
21 // Make a crash during expression calculation
22 CHECK: (lldb) expression sum(buf1, 1000000000)
23 CHECK: The process has been returned to the state before expression evaluation.
25 // Make one more crash
26 CHECK: (lldb) expression sum(buf0, 1)
27 CHECK: The process has been returned to the state before expression evaluation.
29 // Check if the process state was restored succesfully
30 CHECK: (lldb) expression sum(buf0, result - 28)
31 CHECK: (char) $4 = '\0'
33 // Call the function with arbitrary parameters
34 CHECK: (lldb) expression sum(buf1 + 3, 3)
35 CHECK: (char) $5 = '\f'