llvm.org GIT mirror llvm / 719dc0e
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 David Blaikie 3 years ago
4 changed file(s) with 49 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 static volatile int do_mul;
1 static volatile int do_inc;
2
3 int main () {
4 int x = 1;
5 if (do_mul) x *= 2; else x /= 2;
6 return do_inc ? ++x : --x;
7 }
0 some text
1 0x4004f2
2 0x400509
3 0x40050d
4 some more text
0 #static volatile int do_mul;
1 #static volatile int do_inc;
2 #
3 #int main () {
4 # int x = 1;
5 # if (do_mul) x *= 2; else x /= 2;
6 # return do_inc ? ++x : --x;
7 #}
8 #Build as : clang -g -O2 discrim.c -o discrim
9
10 RUN: llvm-symbolizer -verbose -print-address -obj=%p/Inputs/discrim < %p/Inputs/discrim.inp | FileCheck %s
11
12 #CHECK: some text
13
14 #CHECK: 0x4004f2
15 #CHECK-NEXT: main
16 #CHECK-NEXT: Filename: /tmp/discrim.c
17 #CHECK-NEXT: Line: 6
18 #CHECK-NEXT: Column: 7
19 #CHECK-NOT: Discriminator: 0
20
21 #CHECK: 0x400509
22 #CHECK-NEXT: main
23 #CHECK-NEXT: Filename: /tmp/discrim.c
24 #CHECK-NEXT: Line: 7
25 #CHECK-NEXT: Column: 3
26 #CHECK-NEXT: Discriminator: 1
27
28 #CHECK: 0x40050d
29 #CHECK-NEXT: main
30 #CHECK-NEXT: Filename: /tmp/discrim.c
31 #CHECK-NEXT: Line: 7
32 #CHECK-NEXT: Column: 3
33 #CHECK-NEXT: Discriminator: 2
34
35 #CHECK: some more text