blob: 9e4664ad69c9b4b8309e3539c627613b8a238022 [file] [log] [blame]
Dan Gohmanc8054d92009-09-09 00:09:15 +00001; RUN: llc < %s
Tanya Lattner16b222c2004-11-06 23:08:26 +00002
Dylan McKaydb370bd2017-02-08 10:24:18 +00003; Bug: PR31341
4; XFAIL: avr
5
Vikram S. Adve29a64e42003-07-29 14:02:40 +00006;; Date: Jul 29, 2003.
7;; From: test/Programs/MultiSource/Ptrdist-bc
8;; Function: ---
9;; Global: %yy_ec = internal constant [256 x sbyte] ...
10;; A subset of this array is used in the test below.
11;;
12;; Error: Character '\07' was being emitted as '\a', at yy_ec[38].
13;; When loaded, this returned the value 97 ('a'), instead of 7.
14;;
15;; Incorrect LLC Output for the array yy_ec was:
16;; yy_ec_1094:
Vikram S. Adve29a64e42003-07-29 14:02:40 +000017;; .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"
18;;
19
Tanya Lattner3f047732008-02-19 01:41:04 +000020@yy_ec = internal constant [6 x i8] c"\06\07\01\08\01\09" ; <[6 x i8]*> [#uses=1]
21@.str_3 = internal constant [8 x i8] c"[%d] = \00" ; <[8 x i8]*> [#uses=1]
22@.str_4 = internal constant [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1]
Vikram S. Adve29a64e42003-07-29 14:02:40 +000023
Tanya Lattner3f047732008-02-19 01:41:04 +000024declare i32 @printf(i8*, ...)
Vikram S. Adve29a64e42003-07-29 14:02:40 +000025
Tanya Lattner3f047732008-02-19 01:41:04 +000026define i32 @main() {
Vikram S. Adve29a64e42003-07-29 14:02:40 +000027entry:
Tanya Lattner3f047732008-02-19 01:41:04 +000028 br label %loopentry
29
30loopentry: ; preds = %loopentry, %entry
31 %i = phi i64 [ 0, %entry ], [ %inc.i, %loopentry ] ; <i64> [#uses=3]
David Blaikie79e6c742015-02-27 19:29:02 +000032 %cptr = getelementptr [6 x i8], [6 x i8]* @yy_ec, i64 0, i64 %i ; <i8*> [#uses=1]
David Blaikiea79ac142015-02-27 21:17:42 +000033 %c = load i8, i8* %cptr ; <i8> [#uses=1]
David Blaikie23af6482015-04-16 23:24:18 +000034 %ignore = call i32 (i8*, ...) @printf( i8* getelementptr ([8 x i8], [8 x i8]* @.str_3, i64 0, i64 0), i64 %i ) ; <i32> [#uses=0]
35 %ignore2 = call i32 (i8*, ...) @printf( i8* getelementptr ([4 x i8], [4 x i8]* @.str_4, i64 0, i64 0), i8 %c ) ; <i32> [#uses=0]
Tanya Lattner3f047732008-02-19 01:41:04 +000036 %inc.i = add i64 %i, 1 ; <i64> [#uses=2]
37 %done = icmp sle i64 %inc.i, 5 ; <i1> [#uses=1]
38 br i1 %done, label %loopentry, label %exit.1
39
40exit.1: ; preds = %loopentry
41 ret i32 0
42}
43