1#static volatile int do_mul; 2#static volatile int x, v; 3# 4#int foo () { 5# if (do_mul) x *= v; else x /= v; 6# return x; 7#} 8# 9#int main() { 10# return foo() + foo(); 11#} 12#Build as : clang -gmlt -fdebug-info-for-profiling -O2 discrim.c -o discrim 13 14RUN: llvm-symbolizer -verbose -print-address -obj=%p/Inputs/discrim < %p/Inputs/discrim.inp | FileCheck %s 15 16#CHECK: some text 17 18#CHECK: 0x400590 19#CHECK-NEXT: foo 20#CHECK-NEXT: Filename: /tmp{{[\\/]}}discrim.c 21#CHECK-NEXT: Function start filename: /tmp{{[\\/]}}discrim.c 22#CHECK-NEXT: Function start line: 4 23#CHECK-NEXT: Line: 5 24#CHECK-NEXT: Column: 7 25#CHECK-NEXT: main 26#CHECK-NEXT: Filename: /tmp{{[\\/]}}discrim.c 27#CHECK-NEXT: Function start filename: /tmp{{[\\/]}}discrim.c 28#CHECK-NEXT: Function start line: 9 29#CHECK-NEXT: Line: 10 30#CHECK-NEXT: Column: 0 31 32#CHECK: 0x4005a5 33#CHECK-NEXT: foo 34#CHECK-NEXT: Filename: /tmp{{[\\/]}}discrim.c 35#CHECK-NEXT: Function start filename: /tmp{{[\\/]}}discrim.c 36#CHECK-NEXT: Function start line: 4 37#CHECK-NEXT: Line: 5 38#CHECK-NEXT: Column: 17 39#CHECK-NEXT: Discriminator: 2 40#CHECK-NEXT: main 41#CHECK-NEXT: Filename: /tmp{{[\\/]}}discrim.c 42#CHECK-NEXT: Function start filename: /tmp{{[\\/]}}discrim.c 43#CHECK-NEXT: Function start line: 9 44#CHECK-NEXT: Line: 10 45#CHECK-NEXT: Column: 0 46 47#CHECK: 0x4005ad 48#CHECK-NEXT: foo 49#CHECK-NEXT: Filename: /tmp{{[\\/]}}discrim.c 50#CHECK-NEXT: Function start filename: /tmp{{[\\/]}}discrim.c 51#CHECK-NEXT: Function start line: 4 52#CHECK-NEXT: Line: 0 53#CHECK-NEXT: Column: 30 54#CHECK-NEXT: Discriminator: 4 55#CHECK-NEXT: main 56#CHECK-NEXT: Filename: /tmp{{[\\/]}}discrim.c 57#CHECK-NEXT: Function start filename: /tmp{{[\\/]}}discrim.c 58#CHECK-NEXT: Function start line: 9 59#CHECK-NEXT: Line: 10 60#CHECK-NEXT: Column: 0 61 62#CHECK: 0x4005b9 63#CHECK-NEXT: foo 64#CHECK-NEXT: Filename: /tmp{{[\\/]}}discrim.c 65#CHECK-NEXT: Function start filename: /tmp{{[\\/]}}discrim.c 66#CHECK-NEXT: Function start line: 4 67#CHECK-NEXT: Line: 5 68#CHECK-NEXT: Column: 7 69#CHECK-NEXT: main 70#CHECK-NEXT: Filename: /tmp{{[\\/]}}discrim.c 71#CHECK-NEXT: Function start filename: /tmp{{[\\/]}}discrim.c 72#CHECK-NEXT: Function start line: 9 73#CHECK-NEXT: Line: 10 74#CHECK-NEXT: Column: 0 75#CHECK-NEXT: Discriminator: 2 76 77#CHECK: 0x4005ce 78#CHECK-NEXT: foo 79#CHECK-NEXT: Filename: /tmp{{[\\/]}}discrim.c 80#CHECK-NEXT: Function start filename: /tmp{{[\\/]}}discrim.c 81#CHECK-NEXT: Function start line: 4 82#CHECK-NEXT: Line: 5 83#CHECK-NEXT: Column: 17 84#CHECK-NEXT: Discriminator: 2 85#CHECK-NEXT: main 86#CHECK-NEXT: Filename: /tmp{{[\\/]}}discrim.c 87#CHECK-NEXT: Function start filename: /tmp{{[\\/]}}discrim.c 88#CHECK-NEXT: Function start line: 9 89#CHECK-NEXT: Line: 10 90#CHECK-NEXT: Column: 0 91#CHECK-NEXT: Discriminator: 2 92 93#CHECK: 0x4005d4 94#CHECK-NEXT: foo 95#CHECK-NEXT: Filename: /tmp{{[\\/]}}discrim.c 96#CHECK-NEXT: Function start filename: /tmp{{[\\/]}}discrim.c 97#CHECK-NEXT: Function start line: 4 98#CHECK-NEXT: Line: 5 99#CHECK-NEXT: Column: 30 100#CHECK-NEXT: Discriminator: 4 101#CHECK-NEXT: main 102#CHECK-NEXT: Filename: /tmp{{[\\/]}}discrim.c 103#CHECK-NEXT: Function start filename: /tmp{{[\\/]}}discrim.c 104#CHECK-NEXT: Function start line: 9 105#CHECK-NEXT: Line: 10 106#CHECK-NEXT: Column: 0 107#CHECK-NEXT: Discriminator: 2 108 109#CHECK: some more text 110