2017-02-02 01:15:24 +08:00
|
|
|
#static volatile int do_mul;
|
2017-04-18 04:10:39 +08:00
|
|
|
#static volatile int x, v;
|
2017-02-02 01:15:24 +08:00
|
|
|
#
|
2017-04-18 04:10:39 +08:00
|
|
|
#int foo () {
|
|
|
|
# if (do_mul) x *= v; else x /= v;
|
|
|
|
# return x;
|
2017-02-02 01:15:24 +08:00
|
|
|
#}
|
2017-04-18 04:10:39 +08:00
|
|
|
#
|
|
|
|
#int main() {
|
|
|
|
# return foo() + foo();
|
|
|
|
#}
|
|
|
|
#Build as : clang -gmlt -fdebug-info-for-profiling -O2 discrim.c -o discrim
|
2017-02-02 01:15:24 +08:00
|
|
|
|
|
|
|
RUN: llvm-symbolizer -verbose -print-address -obj=%p/Inputs/discrim < %p/Inputs/discrim.inp | FileCheck %s
|
|
|
|
|
|
|
|
#CHECK: some text
|
|
|
|
|
2017-04-18 04:10:39 +08:00
|
|
|
#CHECK: 0x400590
|
|
|
|
#CHECK-NEXT: foo
|
2017-04-18 04:35:32 +08:00
|
|
|
#CHECK-NEXT: Filename: /tmp{{[\\/]}}discrim.c
|
2017-04-18 04:10:39 +08:00
|
|
|
#CHECK-NEXT: Function start line: 4
|
|
|
|
#CHECK-NEXT: Line: 9
|
|
|
|
#CHECK-NEXT: Column: 0
|
2017-02-02 01:15:24 +08:00
|
|
|
#CHECK-NEXT: main
|
2017-04-18 04:35:32 +08:00
|
|
|
#CHECK-NEXT: Filename: /tmp{{[\\/]}}discrim.c
|
2017-04-18 04:10:39 +08:00
|
|
|
#CHECK-NEXT: Function start line: 9
|
|
|
|
#CHECK-NEXT: Line: 10
|
|
|
|
#CHECK-NEXT: Column: 0
|
|
|
|
|
|
|
|
#CHECK: 0x4005a5
|
|
|
|
#CHECK-NEXT: foo
|
2017-04-18 04:35:32 +08:00
|
|
|
#CHECK-NEXT: Filename: /tmp{{[\\/]}}discrim.c
|
2017-02-07 04:19:02 +08:00
|
|
|
#CHECK-NEXT: Function start line: 4
|
2017-04-18 04:10:39 +08:00
|
|
|
#CHECK-NEXT: Line: 5
|
|
|
|
#CHECK-NEXT: Column: 17
|
|
|
|
#CHECK-NEXT: Discriminator: 2
|
|
|
|
#CHECK-NEXT: main
|
2017-04-18 04:35:32 +08:00
|
|
|
#CHECK-NEXT: Filename: /tmp{{[\\/]}}discrim.c
|
2017-04-18 04:10:39 +08:00
|
|
|
#CHECK-NEXT: Function start line: 9
|
|
|
|
#CHECK-NEXT: Line: 10
|
|
|
|
#CHECK-NEXT: Column: 0
|
2017-02-02 01:15:24 +08:00
|
|
|
|
2017-04-18 04:10:39 +08:00
|
|
|
#CHECK: 0x4005ad
|
|
|
|
#CHECK-NEXT: foo
|
2017-04-18 04:35:32 +08:00
|
|
|
#CHECK-NEXT: Filename: /tmp{{[\\/]}}discrim.c
|
2017-04-18 04:10:39 +08:00
|
|
|
#CHECK-NEXT: Function start line: 4
|
|
|
|
#CHECK-NEXT: Line: 0
|
|
|
|
#CHECK-NEXT: Column: 30
|
|
|
|
#CHECK-NEXT: Discriminator: 4
|
2017-02-02 01:15:24 +08:00
|
|
|
#CHECK-NEXT: main
|
2017-04-18 04:35:32 +08:00
|
|
|
#CHECK-NEXT: Filename: /tmp{{[\\/]}}discrim.c
|
2017-04-18 04:10:39 +08:00
|
|
|
#CHECK-NEXT: Function start line: 9
|
|
|
|
#CHECK-NEXT: Line: 10
|
|
|
|
#CHECK-NEXT: Column: 0
|
|
|
|
|
|
|
|
#CHECK: 0x4005b9
|
|
|
|
#CHECK-NEXT: foo
|
2017-04-18 04:35:32 +08:00
|
|
|
#CHECK-NEXT: Filename: /tmp{{[\\/]}}discrim.c
|
2017-02-07 04:19:02 +08:00
|
|
|
#CHECK-NEXT: Function start line: 4
|
2017-04-18 04:10:39 +08:00
|
|
|
#CHECK-NEXT: Line: 5
|
|
|
|
#CHECK-NEXT: Column: 7
|
|
|
|
#CHECK-NEXT: main
|
2017-04-18 04:35:32 +08:00
|
|
|
#CHECK-NEXT: Filename: /tmp{{[\\/]}}discrim.c
|
2017-04-18 04:10:39 +08:00
|
|
|
#CHECK-NEXT: Function start line: 9
|
|
|
|
#CHECK-NEXT: Line: 10
|
|
|
|
#CHECK-NEXT: Column: 0
|
|
|
|
#CHECK-NEXT: Discriminator: 2
|
2017-02-02 01:15:24 +08:00
|
|
|
|
2017-04-18 04:10:39 +08:00
|
|
|
#CHECK: 0x4005ce
|
|
|
|
#CHECK-NEXT: foo
|
2017-04-18 04:35:32 +08:00
|
|
|
#CHECK-NEXT: Filename: /tmp{{[\\/]}}discrim.c
|
2017-04-18 04:10:39 +08:00
|
|
|
#CHECK-NEXT: Function start line: 4
|
|
|
|
#CHECK-NEXT: Line: 5
|
|
|
|
#CHECK-NEXT: Column: 17
|
|
|
|
#CHECK-NEXT: Discriminator: 2
|
2017-02-02 01:15:24 +08:00
|
|
|
#CHECK-NEXT: main
|
2017-04-18 04:35:32 +08:00
|
|
|
#CHECK-NEXT: Filename: /tmp{{[\\/]}}discrim.c
|
2017-04-18 04:10:39 +08:00
|
|
|
#CHECK-NEXT: Function start line: 9
|
|
|
|
#CHECK-NEXT: Line: 10
|
|
|
|
#CHECK-NEXT: Column: 0
|
|
|
|
#CHECK-NEXT: Discriminator: 2
|
|
|
|
|
|
|
|
#CHECK: 0x4005d4
|
|
|
|
#CHECK-NEXT: foo
|
2017-04-18 04:35:32 +08:00
|
|
|
#CHECK-NEXT: Filename: /tmp{{[\\/]}}discrim.c
|
2017-02-07 04:19:02 +08:00
|
|
|
#CHECK-NEXT: Function start line: 4
|
2017-04-18 04:10:39 +08:00
|
|
|
#CHECK-NEXT: Line: 5
|
|
|
|
#CHECK-NEXT: Column: 30
|
|
|
|
#CHECK-NEXT: Discriminator: 4
|
|
|
|
#CHECK-NEXT: main
|
2017-04-18 04:35:32 +08:00
|
|
|
#CHECK-NEXT: Filename: /tmp{{[\\/]}}discrim.c
|
2017-04-18 04:10:39 +08:00
|
|
|
#CHECK-NEXT: Function start line: 9
|
|
|
|
#CHECK-NEXT: Line: 10
|
|
|
|
#CHECK-NEXT: Column: 0
|
2017-02-02 01:15:24 +08:00
|
|
|
#CHECK-NEXT: Discriminator: 2
|
|
|
|
|
|
|
|
#CHECK: some more text
|