xref: /llvm-project/lldb/test/API/macosx/skinny-corefile/to-be-removed.c (revision 9ea6dd5cfac0b233fbb148c1e2d0f81f816737c8)
1 #include <stdio.h>
2 #include <stdlib.h>
3 
4 #include "present.h"
5 #include "to-be-removed.h"
6 
7 const int to_be_removed_const_data = 5;
8 int to_be_removed_dirty_data = 10;
9 
to_be_removed_init(int in)10 void to_be_removed_init(int in) { to_be_removed_dirty_data += 10; }
11 
to_be_removed(char * main_heap_buf,int main_const_data,int main_dirty_data)12 int to_be_removed(char *main_heap_buf, int main_const_data,
13                   int main_dirty_data) {
14   char *to_be_removed_heap_buf = (char *)malloc(256);
15   sprintf(to_be_removed_heap_buf, "got string '%s' have int %d %d %d",
16           main_heap_buf, to_be_removed_dirty_data, main_const_data,
17           main_dirty_data);
18   printf("%s\n", to_be_removed_heap_buf);
19   return present(to_be_removed_heap_buf, to_be_removed_const_data,
20                  to_be_removed_dirty_data);
21 }
22