1*99451b44SJordan Rupprecht //===-- main.c --------------------------------------------------*- C++ -*-===// 2*99451b44SJordan Rupprecht // 3*99451b44SJordan Rupprecht // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4*99451b44SJordan Rupprecht // See https://llvm.org/LICENSE.txt for license information. 5*99451b44SJordan Rupprecht // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6*99451b44SJordan Rupprecht // 7*99451b44SJordan Rupprecht //===----------------------------------------------------------------------===// 8*99451b44SJordan Rupprecht #include <stdio.h> 9*99451b44SJordan Rupprecht #include <string.h> 10*99451b44SJordan Rupprecht 11*99451b44SJordan Rupprecht // This simple program is to test the lldb Python API SBSection. It includes 12*99451b44SJordan Rupprecht // somes global data, and so the build process produces a DATA section, which 13*99451b44SJordan Rupprecht // the test code can use to query for the target byte size 14*99451b44SJordan Rupprecht 15*99451b44SJordan Rupprecht char my_global_var_of_char_type = 'X'; 16*99451b44SJordan Rupprecht 17*99451b44SJordan Rupprecht int main (int argc, char const *argv[]) 18*99451b44SJordan Rupprecht { 19*99451b44SJordan Rupprecht // this code just "does something" with the global so that it is not 20*99451b44SJordan Rupprecht // optimised away 21*99451b44SJordan Rupprecht if (argc > 1 && strlen(argv[1])) 22*99451b44SJordan Rupprecht { 23*99451b44SJordan Rupprecht my_global_var_of_char_type += argv[1][0]; 24*99451b44SJordan Rupprecht } 25*99451b44SJordan Rupprecht 26*99451b44SJordan Rupprecht return my_global_var_of_char_type; 27*99451b44SJordan Rupprecht } 28