1#include <stdio.h>
2
3int inc(int a) {
4 return a + 1;
5}
6
7int main() {
8 printf(format: "%p\n", inc);
9 return 0;
10}
11
12// RUN: rm -rf %t && mkdir -p %t
13// RUN: cp %s %t/
14// RUN: cp %p/Inputs/print_context.o %t
15// RUN: cd %t
16// RUN: llvm-symbolizer --obj=%t/print_context.o 0x0 --print-source-context-lines=5 | FileCheck %s
17
18// Inputs/print_context.o built with plain -g -c from this source file
19// Specifying -Xclang -fdebug-compilation-dir -Xclang . to make the debug info
20// location independent.
21
22// CHECK: inc
23// CHECK-NEXT: print_context.c:3
24// CHECK-NEXT: 1 : #include
25// CHECK-NEXT: 2 :
26// CHECK-NEXT: 3 >: int inc
27// CHECK-NEXT: 4 : return
28// CHECK-NEXT: 5 : }
29// CHECK-NOT: 6
30

source code of llvm/test/tools/llvm-symbolizer/print_context.c