Fix test cases. Patch by Guoling Han.

llvm-svn: 33272
This commit is contained in:
Reid Spencer 2007-01-16 22:31:46 +00:00
parent a3facd734a
commit 4eac5b315d
6 changed files with 31 additions and 30 deletions

View File

@ -1,7 +1,7 @@
; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
; RUN: diff %t1.ll %t2.ll
; XFAIL: *
; This testcase is for testing expressions constructed from
; constant values, including constant pointers to globals.
@ -11,8 +11,8 @@
;; Test constant cast expressions
;;-------------------------------
global i63 0x00001 ; hexadecimal unsigned integer constants
global i63 0x012312 ; hexadecimal signed integer constants
global i63 u0x00001 ; hexadecimal unsigned integer constants
global i63 s0x012312 ; hexadecimal signed integer constants
%t2 = global i33* %t1 ;; Forward reference without cast
%t3 = global i33* bitcast (i33* %t1 to i33*) ;; Forward reference with cast
@ -21,7 +21,8 @@ global i63 0x012312 ; hexadecimal signed integer constants
%t5 = global i33** %t3 ;; Reference to a previous cast
%t6 = global i33*** %t4
%t7 = global float* inttoptr (i32 12345678 to float*) ;; Cast ordinary value to ptr
%t9 = global i33 fp2uint (float sitofp (i33 8 to float) to i33) ;; Nested cast expression
%t9 = global i33 fptosi (float sitofp (i33 8 to float) to i33) ;; Nested cast expression
global i32* bitcast (float* %0 to i32*) ;; Forward numeric reference
global float* %0 ;; Duplicate forward numeric reference
@ -40,7 +41,7 @@ global float 0.0
%char5 = global i8* getelementptr([11x i8]* %somestr, i64 0, i64 5)
;; cast of getelementptr
%char8a = global i33* sext (i8* getelementptr([11x i8]* %somestr, i64 0, i64 8) to i33*)
%char8a = global i33* bitcast (i8* getelementptr([11x i8]* %somestr, i64 0, i64 8) to i33*)
;; getelementptr containing casts
%char8b = global i8* getelementptr([11x i8]* %somestr, i64 sext (i8 0 to i64), i64 sext (i8 8 to i64))

View File

@ -1,7 +1,7 @@
; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
; RUN: diff %t1.ll %t2.ll
; XFAIL: *
%MyVar = external global i27
@ -20,7 +20,7 @@ implementation
define i27 "foo"(i27 %blah)
begin
store i27 5, i27 *%MyVar
%idx = getelementptr { \2 *, i27 } * %MyIntList, i64 0, i27 1
%idx = getelementptr { \2 *, i27 } * %MyIntList, i64 0, i32 1
store i27 12, i27* %idx
ret i27 %blah
end

View File

@ -1,21 +1,21 @@
; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
; RUN: diff %t1.ll %t2.ll
; XFAIL: *
define i39 %test_extractelement(<4 x i39> %V) {
%R = extractelement <4 x i39> %V, i39 1
%R = extractelement <4 x i39> %V, i32 1
ret i39 %R
}
define <4 x i39> %test_insertelement(<4 x i39> %V) {
%R = insertelement <4 x i39> %V, i39 0, i39 0
%R = insertelement <4 x i39> %V, i39 0, i32 0
ret <4 x i39> %R
}
define <4 x i39> %test_shufflevector_u(<4 x i39> %V) {
%R = shufflevector <4 x i39> %V, <4 x i39> %V,
<4 x i39> < i39 1, i39 undef, i39 7, i39 2>
<4 x i32> < i32 1, i32 undef, i32 7, i32 2>
ret <4 x i39> %R
}

View File

@ -1,7 +1,7 @@
; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
; RUN: diff %t1.ll %t2.ll
; XFAIL: *
; This file contains the output from the following compiled C code:
; typedef struct list {
@ -38,7 +38,7 @@
; if (FindData(MyList, 700)) foundIt();
; }
%list = type { %list*, i32 }
%list = type { %list*, i36 }
declare i8 *"malloc"(i32)
@ -66,7 +66,7 @@ bb2:
bb3:
%reg119 = phi %list** [ %reg118, %bb2 ], [ %L, %bb1 ] ;;<%list**>
%cast1006 = bitcast %list** %reg119 to i8** ;;<i8**>
%reg111 = call i8* %malloc(i36 16) ;;<i8*>
%reg111 = call i8* %malloc(i32 16) ;;<i8*>
store i8* %reg111, i8** %cast1006 ;;<void>
%reg111 = ptrtoint i8* %reg111 to i64
%reg1002 = add i64 %reg111, 8
@ -94,7 +94,7 @@ bb3:
ret %list* null
bb4:
%idx = getelementptr %list* %reg115, i64 0, i36 1 ;;<i36>
%idx = getelementptr %list* %reg115, i64 0, i32 1 ;;<i36>
%reg111 = load i36* %idx
%cond1013 = icmp ne i36 %reg111, %Data ;;<i1>
br i1 %cond1013, label %bb6, label %bb5
@ -103,7 +103,7 @@ bb5:
ret %list* %reg115
bb6:
%idx2 = getelementptr %list* %reg115, i64 0, i36 0 ;;<%list*>
%idx2 = getelementptr %list* %reg115, i64 0, i32 0 ;;<%list*>
%reg116 = load %list** %idx2
br label %bb2
end

View File

@ -1,7 +1,7 @@
; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
; RUN: diff %t1.ll %t2.ll
; XFAIL: *
%inners = type {float, {i8 } }
%struct = type { i33 , {float, {i8 } } , i64 }
@ -10,18 +10,18 @@ implementation
define i33 %testfunction(i33 %i0, i33 %j0)
begin
alloca i8, i33 5
alloca i8, i32 5
%ptr = alloca i33 ; yields {i33*}:ptr
store i33 3, i33* %ptr ; yields {void}
%val = load i33* %ptr ; yields {i33}:val = i33 %3
%sptr = alloca %struct ; yields {%struct*}:sptr
%nsptr = getelementptr %struct * %sptr, i64 0, i33 1 ; yields {inners*}:nsptr
%ubsptr = getelementptr %inners * %nsptr, i64 0, i33 1 ; yields {{i8}*}:ubsptr
%idx = getelementptr {i8} * %ubsptr, i64 0, i33 0
%nsptr = getelementptr %struct * %sptr, i64 0, i32 1 ; yields {inners*}:nsptr
%ubsptr = getelementptr %inners * %nsptr, i64 0, i32 1 ; yields {{i8}*}:ubsptr
%idx = getelementptr {i8} * %ubsptr, i64 0, i32 0
store i8 4, i8* %idx
%fptr = getelementptr %struct * %sptr, i64 0, i33 1, i33 0 ; yields {float*}:fptr
%fptr = getelementptr %struct * %sptr, i64 0, i32 1, i32 0 ; yields {float*}:fptr
store float 4.0, float * %fptr
ret i33 3

View File

@ -1,7 +1,7 @@
; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
; RUN: diff %t1.ll %t2.ll
; XFAIL: *
%struct = type { i31 , {float, {i9 } } , i64 }
%complexty = type {i31, {[4 x i9 *], float}, double}
@ -17,9 +17,9 @@ end
define i31 "testfunction"(i64 %i0, i64 %j0)
begin
%array0 = malloc [4 x i9] ; yields {[4 x i9]*}:array0
%size = add i31 2, 2 ; yields {i31}:size = i31 %4
%array1 = malloc i9, i31 4 ; yields {i9*}:array1
%array2 = malloc i9, i31 %size ; yields {i9*}:array2
%size = add i32 2, 2 ; yields {i31}:size = i31 %4
%array1 = malloc i9, i32 4 ; yields {i9*}:array1
%array2 = malloc i9, i32 %size ; yields {i9*}:array2
%idx = getelementptr [4 x i9]* %array0, i64 0, i64 2
store i9 123, i9* %idx
@ -28,8 +28,8 @@ begin
free i9* %array2
%aa = alloca %complexty, i31 5
%idx2 = getelementptr %complexty* %aa, i64 %i0, i31 1, i31 0, i64 %j0
%aa = alloca %complexty, i32 5
%idx2 = getelementptr %complexty* %aa, i64 %i0, i32 1, i32 0, i64 %j0
store i9 *null, i9** %idx2
%ptr = alloca i31 ; yields {i31*}:ptr
@ -37,8 +37,8 @@ begin
%val = load i31* %ptr ; yields {i31}:val = i31 %3
%sptr = alloca %struct ; yields {%struct*}:sptr
%ubsptr = getelementptr %struct * %sptr, i64 0, i31 1, i31 1 ; yields {{i9}*}:ubsptr
%idx3 = getelementptr {i9} * %ubsptr, i64 0, i31 0
%ubsptr = getelementptr %struct * %sptr, i64 0, i32 1, i32 1 ; yields {{i9}*}:ubsptr
%idx3 = getelementptr {i9} * %ubsptr, i64 0, i32 0
store i9 4, i9* %idx3
ret i31 3