1 //===-- main.c --------------------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 int32_t global = 0; // Watchpoint variable declaration.
13 static void modify(int32_t &var) {
17 int main(int argc, char** argv) {
19 printf("&global=%p\n", &global);
20 printf("about to write to 'global'...\n"); // Set break point at this line.
21 // When stopped, watch 'global',
22 // for the condition "global == 5".
23 for (int i = 0; i < 10; ++i)
26 printf("global=%d\n", global);