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 <stdio.h>
9 #include <string.h>
10 
11 // This simple program is to test the lldb Python API SBSection. It includes
12 // somes global data, and so the build process produces a DATA section, which
13 // the test code can use to query for the target byte size
14 
15 char my_global_var_of_char_type = 'X';
16 
17 int main (int argc, char const *argv[])
18 {
19     // this code just "does something" with the global so that it is not
20     // optimised away
21     if (argc > 1 && strlen(argv[1]))
22     {
23         my_global_var_of_char_type += argv[1][0];
24     }
25 
26     return my_global_var_of_char_type;
27 }
28