brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · b41a81f Raw
53 lines · cpp
1// Tests evaluating expressions with side effects on convenience variable.2// Applied side effect should be visible to the debugger.3 4// UNSUPPORTED: system-windows5 6// RUN: %build %s -o %t7// RUN: %lldb %t \8// RUN:   -o "settings set target.process.track-memory-cache-changes false" \9// RUN:   -o "run" \10// RUN:   -o "expr int \$y = 11" \11// RUN:   -o "expr \$y" \12// RUN:   -o "expr \$y = 100" \13// RUN:   -o "expr \$y" \14// RUN:   -o "continue" \15// RUN:   -o "expr \$y" \16// RUN:   -o "expr X \$mine = {100, 200}" \17// RUN:   -o "expr \$mine.a = 300" \18// RUN:   -o "expr \$mine" \19// RUN:   -o "exit" | FileCheck %s -dump-input=fail20 21struct X {22  int a;23  int b;24};25 26int main() {27  X x;28 29  __builtin_debugtrap();30  __builtin_debugtrap();31  return 0;32}33 34// CHECK-LABEL: expr int $y = 1135// CHECK-LABEL: expr $y36// CHECK: (int) $y = 1137 38// CHECK-LABEL: expr $y = 10039// CHECK: (int) $0 = 10040 41// CHECK-LABEL: expr $y42// CHECK: (int) $y = 10043 44// CHECK-LABEL: continue45// CHECK-LABEL: expr $y46// CHECK: (int) $y = 10047 48// CHECK-LABEL: expr X $mine = {100, 200}49// CHECK-LABEL: expr $mine.a = 30050// CHECK: (int) $1 = 30051// CHECK-LABEL: expr $mine52// CHECK: (X) $mine = (a = 300, b = 200)53