diff options
author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2003-07-29 14:02:40 +0000 |
---|---|---|
committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2003-07-29 14:02:40 +0000 |
commit | 46721dde71cb1926cac9d7ef9e193590deb4ae05 (patch) | |
tree | d3c7c66a0ed110c8a99ba0210a8830656dfde16d /test | |
parent | 38dbde19cc59ec1b6daaeb919890cadd02ba64c1 (diff) | |
download | external_llvm-46721dde71cb1926cac9d7ef9e193590deb4ae05.zip external_llvm-46721dde71cb1926cac9d7ef9e193590deb4ae05.tar.gz external_llvm-46721dde71cb1926cac9d7ef9e193590deb4ae05.tar.bz2 |
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
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/Generic/2003-07-29-BadConstSbyte.ll | 39 | ||||
-rw-r--r-- | test/LLC/2003-07-29-BadConstSbyte.ll | 39 |
2 files changed, 78 insertions, 0 deletions
diff --git a/test/CodeGen/Generic/2003-07-29-BadConstSbyte.ll b/test/CodeGen/Generic/2003-07-29-BadConstSbyte.ll new file mode 100644 index 0000000..32da5cb --- /dev/null +++ b/test/CodeGen/Generic/2003-07-29-BadConstSbyte.ll @@ -0,0 +1,39 @@ +;; 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 sbyte] c"\06\07\01\08\01\09" + +%.str_3 = internal constant [8 x sbyte] c"[%d] = \00" +%.str_4 = internal constant [4 x sbyte] c"%d\0A\00" + +implementation + +declare int %printf(sbyte*, ...) + +int %main() { +entry: + br label %loopentry +loopentry: + %i = phi long [0, %entry], [%inc.i, %loopentry] + %cptr = getelementptr [6 x sbyte]* %yy_ec, long 0, long %i + %c = load sbyte* %cptr + %ignore = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([8 x sbyte]* %.str_3, long 0, long 0), long %i) + %ignore2 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([4 x sbyte]* %.str_4, long 0, long 0), sbyte %c) + %inc.i = add long %i, 1 + %done = setle long %inc.i, 5 + br bool %done, label %loopentry, label %exit.1 +exit.1: + ret int 0 +}; diff --git a/test/LLC/2003-07-29-BadConstSbyte.ll b/test/LLC/2003-07-29-BadConstSbyte.ll new file mode 100644 index 0000000..32da5cb --- /dev/null +++ b/test/LLC/2003-07-29-BadConstSbyte.ll @@ -0,0 +1,39 @@ +;; 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 sbyte] c"\06\07\01\08\01\09" + +%.str_3 = internal constant [8 x sbyte] c"[%d] = \00" +%.str_4 = internal constant [4 x sbyte] c"%d\0A\00" + +implementation + +declare int %printf(sbyte*, ...) + +int %main() { +entry: + br label %loopentry +loopentry: + %i = phi long [0, %entry], [%inc.i, %loopentry] + %cptr = getelementptr [6 x sbyte]* %yy_ec, long 0, long %i + %c = load sbyte* %cptr + %ignore = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([8 x sbyte]* %.str_3, long 0, long 0), long %i) + %ignore2 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([4 x sbyte]* %.str_4, long 0, long 0), sbyte %c) + %inc.i = add long %i, 1 + %done = setle long %inc.i, 5 + br bool %done, label %loopentry, label %exit.1 +exit.1: + ret int 0 +}; |