xref: /llvm-project/lldb/test/API/macosx/skinny-corefile/present.c (revision 9ea6dd5cfac0b233fbb148c1e2d0f81f816737c8)
1 #include <stdio.h>
2 #include <stdlib.h>
3 
4 #include "present.h"
5 
6 const int present_const_data = 5;
7 int present_dirty_data = 10;
8 
present_init(int in)9 void present_init(int in) { present_dirty_data += 10; }
10 
present(char * to_be_removed_heap_buf,int to_be_removed_const_data,int to_be_removed_dirty_data)11 int present(char *to_be_removed_heap_buf, int to_be_removed_const_data,
12             int to_be_removed_dirty_data) {
13   char *present_heap_buf = (char *)malloc(256);
14   sprintf(present_heap_buf, "have ints %d %d %d %d", to_be_removed_const_data,
15           to_be_removed_dirty_data, present_dirty_data, present_const_data);
16   printf("%s\n", present_heap_buf);
17   puts(to_be_removed_heap_buf);
18 
19   puts("break here");
20 
21   return present_const_data + present_dirty_data;
22 }
23