Add missing test cases from r293697/D29094

Differential Revision: https://reviews.llvm.org/D29368

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293785 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie 2017-02-01 17:15:24 +00:00
parent 387f151ad9
commit 719dc0e356
4 changed files with 49 additions and 0 deletions

Binary file not shown.

View File

@ -0,0 +1,8 @@
static volatile int do_mul;
static volatile int do_inc;
int main () {
int x = 1;
if (do_mul) x *= 2; else x /= 2;
return do_inc ? ++x : --x;
}

View File

@ -0,0 +1,5 @@
some text
0x4004f2
0x400509
0x40050d
some more text

View File

@ -0,0 +1,36 @@
#static volatile int do_mul;
#static volatile int do_inc;
#
#int main () {
# int x = 1;
# if (do_mul) x *= 2; else x /= 2;
# return do_inc ? ++x : --x;
#}
#Build as : clang -g -O2 discrim.c -o discrim
RUN: llvm-symbolizer -verbose -print-address -obj=%p/Inputs/discrim < %p/Inputs/discrim.inp | FileCheck %s
#CHECK: some text
#CHECK: 0x4004f2
#CHECK-NEXT: main
#CHECK-NEXT: Filename: /tmp/discrim.c
#CHECK-NEXT: Line: 6
#CHECK-NEXT: Column: 7
#CHECK-NOT: Discriminator: 0
#CHECK: 0x400509
#CHECK-NEXT: main
#CHECK-NEXT: Filename: /tmp/discrim.c
#CHECK-NEXT: Line: 7
#CHECK-NEXT: Column: 3
#CHECK-NEXT: Discriminator: 1
#CHECK: 0x40050d
#CHECK-NEXT: main
#CHECK-NEXT: Filename: /tmp/discrim.c
#CHECK-NEXT: Line: 7
#CHECK-NEXT: Column: 3
#CHECK-NEXT: Discriminator: 2
#CHECK: some more text