1# RUN: %clangxx_host -std=c++11 %p/Inputs/stop-hook-threads.cpp -g -o %t
2# RUN: %lldb -b -s %p/Inputs/stop-hook-threads-1.lldbinit -s %s -f %t \
3# RUN:     | FileCheck --check-prefix=CHECK --check-prefix=CHECK-NO-FILTER %s
4# RUN: %lldb -b -s %p/Inputs/stop-hook-threads-2.lldbinit -s %s -f %t \
5# RUN:     | FileCheck --check-prefix=CHECK --check-prefix=CHECK-FILTER %s
6# XFAIL: system-freebsd
7# XFAIL: system-netbsd
8# UNSUPPORTED: system-windows
9# This test is flakey and hangs on windows periodically: llvm.org/pr38373
10# UNSUPPORTED: system-linux, system-darwin
11
12thread list
13break set -f stop-hook-threads.cpp -p "Set break point at this line"
14target stop-hook list
15
16# CHECK: Hook: 1
17# CHECK-NEXT:  State: enabled
18# CHECK-NO-FILTER-NEXT: AutoContinue on
19# CHECK-FILTER-NEXT:  Thread
20# CHECK-FILTER-NEXT:  index: 2
21# CHECK-NEXT:  Commands:
22# CHECK-NEXT:    expr lldb_val += 1
23# CHECK-NEXT:    thread list
24
25# CHECK-FILTER: Hook: 2
26# CHECK-FILTER-NEXT:  State: enabled
27# CHECK-FILTER-NEXT:  AutoContinue on
28# CHECK-FILTER-NEXT:  Commands:
29# CHECK-FILTER-NEXT:    script print('Hit stop hook')
30
31# Get the threads going
32continue
33
34# Now make sure we hit the command the right number of times:
35# CHECK-NO-FILTER: lldb_val was set to: 15.
36# CHECK-FILTER: lldb_val was set to: 5.
37