; 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.
;; 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
%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
%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))
; 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
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
; 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
}
; 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 {
; if (FindData(MyList, 700)) foundIt();
; }
-%list = type { %list*, i32 }
+%list = type { %list*, i36 }
declare i8 *"malloc"(i32)
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
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
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
; 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 }
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
; 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}
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
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
%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