blob: 54880db3928968ae03edf310938fd7cae17f4843 [file] [log] [blame]
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +00001; RUN: llvm-as < %s | llc
Dan Gohmanf17a25c2007-07-18 16:29:46 +00002
3;; 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:
14;; .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
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000017@yy_ec = internal constant [6 x i8] c"\06\07\01\08\01\09" ; <[6 x i8]*> [#uses=1]
18@.str_3 = internal constant [8 x i8] c"[%d] = \00" ; <[8 x i8]*> [#uses=1]
19@.str_4 = internal constant [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1]
Dan Gohmanf17a25c2007-07-18 16:29:46 +000020
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000021declare i32 @printf(i8*, ...)
Dan Gohmanf17a25c2007-07-18 16:29:46 +000022
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000023define i32 @main() {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000024entry:
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000025 br label %loopentry
26
27loopentry: ; preds = %loopentry, %entry
28 %i = phi i64 [ 0, %entry ], [ %inc.i, %loopentry ] ; <i64> [#uses=3]
29 %cptr = getelementptr [6 x i8]* @yy_ec, i64 0, i64 %i ; <i8*> [#uses=1]
30 %c = load i8* %cptr ; <i8> [#uses=1]
31 %ignore = call i32 (i8*, ...)* @printf( i8* getelementptr ([8 x i8]* @.str_3, i64 0, i64 0), i64 %i ) ; <i32> [#uses=0]
32 %ignore2 = call i32 (i8*, ...)* @printf( i8* getelementptr ([4 x i8]* @.str_4, i64 0, i64 0), i8 %c ) ; <i32> [#uses=0]
33 %inc.i = add i64 %i, 1 ; <i64> [#uses=2]
34 %done = icmp sle i64 %inc.i, 5 ; <i1> [#uses=1]
35 br i1 %done, label %loopentry, label %exit.1
36
37exit.1: ; preds = %loopentry
38 ret i32 0
39}
40