1 //===-- main.c --------------------------------------------------*- 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 #include <stdint.h> 9 10 struct foo 11 { 12 uint32_t a; 13 uint32_t b; 14 float c; 15 foo() : a(0), b(1), c(3.14) {} 16 foo(uint32_t A, uint32_t B, float C) : 17 a(A), 18 b(B), 19 c(C) 20 {} 21 }; 22 23 int main (int argc, char const *argv[]) 24 { 25 foo* foobar = new foo[2]; 26 27 foobar[0].a = 1; 28 foobar[0].b = 9; 29 30 foobar[1].a = 8; 31 foobar[1].b = 5; 32 33 foobar[1].b = 7; // set breakpoint here 34 35 foobar[1].c = 6.28; 36 37 foo barfoo[] = {foo(1,2,3), foo(4,5,6)}; 38 39 delete[] foobar; 40 41 return 0; 42 } 43