xref: /llvm-project/lldb/test/API/functionalities/location-list-lookup/main.cpp (revision 58bdef2be75263a9b6bf93faf3baccc76e31e082)
1 #include <cstdio>
2 #include <cstdlib>
3 
4 void func(int in);
5 
6 struct Foo {
7   int x;
8   [[clang::noinline]] void bar(char **argv);
9 };
10 
main(int argc,char ** argv)11 int main(int argc, char **argv) {
12   Foo f{.x = 5};
13   std::printf("%p\n", &f.x);
14   f.bar(argv);
15   return f.x;
16 }
17 
bar(char ** argv)18 void Foo::bar(char **argv) {
19   std::printf("%p %p\n", argv, this);
20   std::abort(); /// 'this' should be still accessible
21 }
22 
func(int in)23 void func(int in) { printf("%d\n", in); }
24