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.
14 static void modify(int32_t &var) {
18 int main(int argc, char** argv) {
20 printf("&global=%p\n", &global);
21 printf("about to write to 'global'...\n"); // Set break point at this line.
22 for (int i = 0; i < 10; ++i)
25 printf("global=%d\n", global);
26 printf("cookie=%d\n", cookie);