File: 2003-07-29-BadConstSbyte.ll

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 1,998,492 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (42 lines) | stat: -rw-r--r-- 2,479 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
; RUN: llc < %s

; Bug: PR31341

;; Date:     Jul 29, 2003.
;; From:     test/Programs/MultiSource/Ptrdist-bc
;; Function: ---
;; Global:   %yy_ec = internal constant [256 x sbyte] ...
;;           A subset of this array is used in the test below.
;;
;; Error:    Character '\07' was being emitted as '\a', at yy_ec[38].
;;	     When loaded, this returned the value 97 ('a'), instead of 7.
;; 
;; Incorrect LLC Output for the array yy_ec was:
;; yy_ec_1094:
;; 	.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"
;;

@yy_ec = internal constant [6 x i8] c"\06\07\01\08\01\09"               ; <ptr> [#uses=1]
@.str_3 = internal constant [8 x i8] c"[%d] = \00"              ; <ptr> [#uses=1]
@.str_4 = internal constant [4 x i8] c"%d\0A\00"                ; <ptr> [#uses=1]

declare i32 @printf(ptr, ...)

define i32 @main() {
entry:
        br label %loopentry

loopentry:              ; preds = %loopentry, %entry
        %i = phi i64 [ 0, %entry ], [ %inc.i, %loopentry ]              ; <i64> [#uses=3]
        %cptr = getelementptr [6 x i8], ptr @yy_ec, i64 0, i64 %i           ; <ptr> [#uses=1]
        %c = load i8, ptr %cptr             ; <i8> [#uses=1]
        %ignore = call i32 (ptr, ...) @printf( ptr @.str_3, i64 %i )        ; <i32> [#uses=0]
        %ignore2 = call i32 (ptr, ...) @printf( ptr @.str_4, i8 %c )        ; <i32> [#uses=0]
        %inc.i = add i64 %i, 1          ; <i64> [#uses=2]
        %done = icmp sle i64 %inc.i, 5          ; <i1> [#uses=1]
        br i1 %done, label %loopentry, label %exit.1

exit.1:         ; preds = %loopentry
        ret i32 0
}