1 //===-- main.cpp ------------------------------------------------*- C++ -*-===// 2 // 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 6 // 7 //===----------------------------------------------------------------------===// 8 9 class Point { 10 public: 11 int x; 12 int y; 13 Point(int a, int b): 14 x(a), 15 y(b) 16 {} 17 }; 18 19 class Data { 20 public: 21 int id; 22 Point point; 23 Data(int i): 24 id(i), 25 point(0, 0) 26 {} 27 }; 28 29 int main(int argc, char const *argv[]) { 30 Data *data[1000]; 31 Data **ptr = data; 32 for (int i = 0; i < 1000; ++i) { 33 ptr[i] = new Data(i); 34 ptr[i]->point.x = i; 35 ptr[i]->point.y = i+1; 36 } 37 38 for (int i = 0; i < 1000; ++i) { 39 bool dump = argc > 1; // Set breakpoint here. 40 // Evaluate a couple of expressions (2*1000 = 2000 exprs): 41 // expr ptr[i]->point.x 42 // expr ptr[i]->point.y 43 } 44 return 0; 45 } 46