llvm.org GIT mirror llvm / 46721dd
Regression test for incorrect character emitted to char array. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7379 91177308-0d34-0410-b5e6-96231b3b80d8 Vikram S. Adve 16 years ago
2 changed file(s) with 78 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ;; Date: Jul 29, 2003.
1 ;; From: test/Programs/MultiSource/Ptrdist-bc
2 ;; Function: ---
3 ;; Global: %yy_ec = internal constant [256 x sbyte] ...
4 ;; A subset of this array is used in the test below.
5 ;;
6 ;; Error: Character '\07' was being emitted as '\a', at yy_ec[38].
7 ;; When loaded, this returned the value 97 ('a'), instead of 7.
8 ;;
9 ;; Incorrect LLC Output for the array yy_ec was:
10 ;; yy_ec_1094:
11 ;; .ascii "\000\001\001\001\001\001\001\001\001\002\003\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\002\004\005\001\001\006\a\001\b\t\n\v\f\r\016\017\020\020\020\020\020\020\020\020\020\020\001\021\022\023\024\001\001\025\025\025\025\025\025\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\026\027\030\031\032\001\033\034\035\036\037 !\"#$%&'()*+,-./$0$1$234\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001"
12 ;;
13
14
15 %yy_ec = internal constant [6 x sbyte] c"\06\07\01\08\01\09"
16
17 %.str_3 = internal constant [8 x sbyte] c"[%d] = \00"
18 %.str_4 = internal constant [4 x sbyte] c"%d\0A\00"
19
20 implementation
21
22 declare int %printf(sbyte*, ...)
23
24 int %main() {
25 entry:
26 br label %loopentry
27 loopentry:
28 %i = phi long [0, %entry], [%inc.i, %loopentry]
29 %cptr = getelementptr [6 x sbyte]* %yy_ec, long 0, long %i
30 %c = load sbyte* %cptr
31 %ignore = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([8 x sbyte]* %.str_3, long 0, long 0), long %i)
32 %ignore2 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([4 x sbyte]* %.str_4, long 0, long 0), sbyte %c)
33 %inc.i = add long %i, 1
34 %done = setle long %inc.i, 5
35 br bool %done, label %loopentry, label %exit.1
36 exit.1:
37 ret int 0
38 };
0 ;; Date: Jul 29, 2003.
1 ;; From: test/Programs/MultiSource/Ptrdist-bc
2 ;; Function: ---
3 ;; Global: %yy_ec = internal constant [256 x sbyte] ...
4 ;; A subset of this array is used in the test below.
5 ;;
6 ;; Error: Character '\07' was being emitted as '\a', at yy_ec[38].
7 ;; When loaded, this returned the value 97 ('a'), instead of 7.
8 ;;
9 ;; Incorrect LLC Output for the array yy_ec was:
10 ;; yy_ec_1094:
11 ;; .ascii "\000\001\001\001\001\001\001\001\001\002\003\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\002\004\005\001\001\006\a\001\b\t\n\v\f\r\016\017\020\020\020\020\020\020\020\020\020\020\001\021\022\023\024\001\001\025\025\025\025\025\025\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\026\027\030\031\032\001\033\034\035\036\037 !\"#$%&'()*+,-./$0$1$234\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001"
12 ;;
13
14
15 %yy_ec = internal constant [6 x sbyte] c"\06\07\01\08\01\09"
16
17 %.str_3 = internal constant [8 x sbyte] c"[%d] = \00"
18 %.str_4 = internal constant [4 x sbyte] c"%d\0A\00"
19
20 implementation
21
22 declare int %printf(sbyte*, ...)
23
24 int %main() {
25 entry:
26 br label %loopentry
27 loopentry:
28 %i = phi long [0, %entry], [%inc.i, %loopentry]
29 %cptr = getelementptr [6 x sbyte]* %yy_ec, long 0, long %i
30 %c = load sbyte* %cptr
31 %ignore = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([8 x sbyte]* %.str_3, long 0, long 0), long %i)
32 %ignore2 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([4 x sbyte]* %.str_4, long 0, long 0), sbyte %c)
33 %inc.i = add long %i, 1
34 %done = setle long %inc.i, 5
35 br bool %done, label %loopentry, label %exit.1
36 exit.1:
37 ret int 0
38 };