1#Source: 2##include <stdio.h> 3#static inline int inctwo (int *a) { 4# printf ("%d\n",(*a)++); 5# return (*a)++; 6#} 7#static inline int inc (int *a) { 8# printf ("%d\n",inctwo(a)); 9# return (*a)++; 10#} 11# 12# 13#int main () { 14# int x = 1; 15# return inc(&x); 16#} 17# 18#Build as : clang -g -O2 addr.c 19 20RUN: llvm-symbolizer -print-address -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck %s 21RUN: llvm-symbolizer -addresses -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck %s 22RUN: llvm-symbolizer -a -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck %s 23RUN: llvm-symbolizer -inlining -print-address -pretty-print -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck -check-prefix="PRETTY" %s 24RUN: llvm-symbolizer -inlining -print-address -p -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck -check-prefix="PRETTY" %s 25RUN: llvm-symbolizer -inlines -print-address -pretty-print -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck -check-prefix="PRETTY" %s 26RUN: llvm-symbolizer -inlines -print-address -p -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck -check-prefix="PRETTY" %s 27RUN: llvm-symbolizer -i -print-address -pretty-print -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck -check-prefix="PRETTY" %s 28RUN: llvm-symbolizer -i -print-address -p -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck -check-prefix="PRETTY" %s 29## Before 2020-08-04, asan_symbolize.py passed --inlining=true. 30## Support this compatibility alias for a while. 31RUN: llvm-symbolizer --inlining=true --print-address -p --obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck -check-prefix="PRETTY" %s 32 33RUN: echo "0x1" > %t.input 34RUN: llvm-symbolizer -obj=%p/Inputs/zero < %t.input | FileCheck -check-prefix="ZERO" %s 35 36RUN: llvm-addr2line -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck -check-prefix=A2L %s 37RUN: llvm-addr2line -a -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck -check-prefixes=A2L,A2L_A %s 38RUN: llvm-addr2line -f -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck -check-prefixes=A2L,A2L_F %s 39RUN: llvm-addr2line -i -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck -check-prefixes=A2L,A2L_I %s 40RUN: llvm-addr2line -fi -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck -check-prefixes=A2L,A2L_F,A2L_I,A2L_FI %s 41 42RUN: llvm-addr2line -pa -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck -check-prefixes=A2LP,A2LP_A %s 43RUN: llvm-addr2line -pf -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck -check-prefixes=A2LP,A2LP_F %s 44RUN: llvm-addr2line -paf -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck -check-prefixes=A2LP,A2LP_AF %s 45RUN: llvm-addr2line -pai -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck -check-prefixes=A2LP,A2LP_A,A2LP_I %s 46RUN: llvm-addr2line -pfi -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck -check-prefixes=A2LP,A2LP_F,A2LP_FI %s 47RUN: llvm-addr2line -pafi -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck -check-prefixes=A2LP,A2LP_AF,A2LP_FI %s 48 49# CHECK: some text 50# CHECK-NEXT: 0x40054d 51# CHECK-NEXT: inctwo 52# CHECK-NEXT: {{[/\]+}}tmp{{[/\]+}}x.c:3:3 53# CHECK-NEXT: inc 54# CHECK-NEXT: {{[/\]+}}tmp{{[/\]+}}x.c:7:0 55# CHECK-NEXT: main 56# CHECK-NEXT: {{[/\]+}}tmp{{[/\]+}}x.c:14:0 57# CHECK-EMPTY: 58# CHECK-NEXT: some text2 59# 60#PRETTY: some text 61#PRETTY: {{[0x]+}}40054d: inctwo at {{[/\]+}}tmp{{[/\]+}}x.c:3:3 62#PRETTY: (inlined by) inc at {{[/\]+}}tmp{{[/\]+}}x.c:7:0 63#PRETTY: (inlined by) main at {{[/\]+}}tmp{{[/\]+}}x.c:14:0 64#PRETTY: some text2 65# 66#ZERO: ?? 67#ZERO: ??:0:0 68# 69#A2L: some text 70#A2L_A-NEXT: 0x40054d 71#A2L_F-NEXT: inctwo 72#A2L-NEXT: {{[/\]+}}tmp{{[/\]+}}x.c:3{{$}} 73#A2L_FI-NEXT: inc{{$}} 74#A2L_I-NEXT: {{[/\]+}}tmp{{[/\]+}}x.c:7{{$}} 75#A2L_FI-NEXT: main 76#A2L_I-NEXT: {{[/\]+}}tmp{{[/\]+}}x.c:14{{$}} 77#A2L-NEXT: some text2 78 79#A2LP: some text 80#A2LP_A-NEXT: 0x40054d: {{[/\]+}}tmp{{[/\]+}}x.c:3{{$}} 81#A2LP_F-NEXT: inctwo at {{[/\]+}}tmp{{[/\]+}}x.c:3{{$}} 82#A2LP_AF-NEXT: 0x40054d: inctwo at {{[/\]+}}tmp{{[/\]+}}x.c:3{{$}} 83#A2LP_I-NEXT: {{[/\]+}}tmp{{[/\]+}}x.c:7{{$}} 84#A2LP_I-NEXT: {{[/\]+}}tmp{{[/\]+}}x.c:14{{$}} 85#A2LP_FI-NEXT: (inlined by) inc at {{[/\]+}}tmp{{[/\]+}}x.c:7{{$}} 86#A2LP_FI-NEXT: (inlined by) main at {{[/\]+}}tmp{{[/\]+}}x.c:14{{$}} 87#A2LP-NEXT: some text2 88