]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-smart-array/main.cpp
Vendor import of lldb trunk r256945:
[FreeBSD/FreeBSD.git] / packages / Python / lldbsuite / test / functionalities / data-formatter / data-formatter-smart-array / main.cpp
1 //===-- main.cpp ------------------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #include <stdio.h>
11 #include <stdlib.h>
12 #include <stdint.h>
13 #include <string.h>
14
15 struct SomeData
16 {
17     int x;
18 };
19
20 struct SomeOtherData
21 {
22     char strarr[32];
23     char *strptr;
24     int intarr[5];
25     float flarr[7];
26     
27     SomeOtherData()
28     {
29         strcpy(strarr,"Nested Hello world!");
30         strptr = new char[128];
31         strcpy(strptr,"Nested Hello world!");
32         intarr[0] = 9;
33         intarr[1] = 8;
34         intarr[2] = 7;
35         intarr[3] = 6;
36         intarr[4] = 5;
37         
38         flarr[0] = 25.5;
39         flarr[1] = 25.25;
40         flarr[2] = 25.125;
41         flarr[3] = 26.75;
42         flarr[4] = 27.375;
43         flarr[5] = 27.5;
44         flarr[6] = 26.125;
45     }
46 };
47
48 int main (int argc, const char * argv[])
49 {
50     char strarr[32] = "Hello world!";
51     char *strptr = NULL;
52     strptr = "Hello world!";
53     int intarr[5] = {1,1,2,3,5};
54     float flarr[7] = {78.5,77.25,78.0,76.125,76.75,76.875,77.0};
55     
56     SomeData data;
57     
58     SomeOtherData other;
59     
60     float* flptr = flarr;
61     int* intptr = intarr;
62     
63     return 0; // Set break point at this line.
64     
65 }