blob: 0a1f6deb5fff992248a66388861203de51882012 [file] [log] [blame]
Tanya Lattner2393a242004-11-06 23:08:26 +00001; RUN: llvm-as -f %s -o - | llc
2
Vikram S. Adve46721dd2003-07-29 14:02:40 +00003;; Date: Jul 29, 2003.
4;; From: test/Programs/MultiSource/Ptrdist-bc
5;; Function: ---
6;; Global: %yy_ec = internal constant [256 x sbyte] ...
7;; A subset of this array is used in the test below.
8;;
9;; Error: Character '\07' was being emitted as '\a', at yy_ec[38].
10;; When loaded, this returned the value 97 ('a'), instead of 7.
11;;
12;; Incorrect LLC Output for the array yy_ec was:
13;; yy_ec_1094:
Vikram S. Adve46721dd2003-07-29 14:02:40 +000014;; .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"
15;;
16
17
18%yy_ec = internal constant [6 x sbyte] c"\06\07\01\08\01\09"
19
20%.str_3 = internal constant [8 x sbyte] c"[%d] = \00"
21%.str_4 = internal constant [4 x sbyte] c"%d\0A\00"
22
23implementation
24
25declare int %printf(sbyte*, ...)
26
27int %main() {
28entry:
29 br label %loopentry
30loopentry:
31 %i = phi long [0, %entry], [%inc.i, %loopentry]
32 %cptr = getelementptr [6 x sbyte]* %yy_ec, long 0, long %i
33 %c = load sbyte* %cptr
34 %ignore = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([8 x sbyte]* %.str_3, long 0, long 0), long %i)
35 %ignore2 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([4 x sbyte]* %.str_4, long 0, long 0), sbyte %c)
36 %inc.i = add long %i, 1
37 %done = setle long %inc.i, 5
38 br bool %done, label %loopentry, label %exit.1
39exit.1:
40 ret int 0
41};