diff options
author | Tanya Lattner <tonic@nondot.org> | 2008-03-01 07:38:40 +0000 |
---|---|---|
committer | Tanya Lattner <tonic@nondot.org> | 2008-03-01 07:38:40 +0000 |
commit | 9bc243b2517f4f1aef3319ba01ea6f0788e87cb6 (patch) | |
tree | e3b7a85489213ca435df8fdecb7a12601e2f00ac /test/Feature | |
parent | e5101bf52c8c9b96e072c10f1a141ef021971137 (diff) | |
download | external_llvm-9bc243b2517f4f1aef3319ba01ea6f0788e87cb6.zip external_llvm-9bc243b2517f4f1aef3319ba01ea6f0788e87cb6.tar.gz external_llvm-9bc243b2517f4f1aef3319ba01ea6f0788e87cb6.tar.bz2 |
Remove llvm-upgrade and update tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47784 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Feature')
40 files changed, 624 insertions, 705 deletions
diff --git a/test/Feature/alignment.ll b/test/Feature/alignment.ll index 9277dbc..409efeb 100644 --- a/test/Feature/alignment.ll +++ b/test/Feature/alignment.ll @@ -1,20 +1,21 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll -%X = global int 4, align 16 +@X = global i32 4, align 16 ; <i32*> [#uses=0] -int *%test() align 32 { - %X = alloca int, align 4 - %Y = alloca int, uint 42, align 16 - %Z = alloca int, align 0 - ret int *%X +define i32* @test() align 32 { + %X = alloca i32, align 4 ; <i32*> [#uses=1] + %Y = alloca i32, i32 42, align 16 ; <i32*> [#uses=0] + %Z = alloca i32 ; <i32*> [#uses=0] + ret i32* %X } -int *%test2() { - %X = malloc int, align 4 - %Y = malloc int, uint 42, align 16 - %Z = malloc int, align 0 - %T = malloc int, align 256 - ret int *%X +define i32* @test2() { + %X = malloc i32, align 4 ; <i32*> [#uses=1] + %Y = malloc i32, i32 42, align 16 ; <i32*> [#uses=0] + %Z = malloc i32 ; <i32*> [#uses=0] + %T = malloc i32, align 256 ; <i32*> [#uses=0] + ret i32* %X } + diff --git a/test/Feature/basictest.ll b/test/Feature/basictest.ll index cf040ec..2303b59 100644 --- a/test/Feature/basictest.ll +++ b/test/Feature/basictest.ll @@ -1,32 +1,31 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll -implementation - ; Test "stripped" format where nothing is symbolic... this is how the bytecode ; format looks anyways (except for negative vs positive offsets)... ; -void "void"(int, int) ; Def %0, %1 -begin - add int 0, 0 ; Def 2 - sub int 0, 4 ; Def 3 - br label %1 - add int %0, %1 ; Def 4 - sub int %4, %3 ; Def 5 - setle int %5, %2 ; Def 0 - bool plane - br bool %0, label %2, label %1 +define void @void(i32, i32) { + add i32 0, 0 ; <i32>:3 [#uses=2] + sub i32 0, 4 ; <i32>:4 [#uses=2] + br label %5 + +; <label>:5 ; preds = %5, %2 + add i32 %0, %1 ; <i32>:6 [#uses=2] + sub i32 %6, %4 ; <i32>:7 [#uses=1] + icmp sle i32 %7, %3 ; <i1>:8 [#uses=1] + br i1 %8, label %9, label %5 - add int %0, %1 ; Def 6 - sub int %4, %3 ; Def 7 - setle int %7, %2 ; Def 1 - bool plane - ret void -end +; <label>:9 ; preds = %5 + add i32 %0, %1 ; <i32>:10 [#uses=0] + sub i32 %6, %4 ; <i32>:11 [#uses=1] + icmp sle i32 %11, %3 ; <i1>:12 [#uses=0] + ret void +} ; This function always returns zero -int "zarro"() -begin +define i32 @zarro() { Startup: - ret int 0 -end + ret i32 0 +} diff --git a/test/Feature/callingconventions.ll b/test/Feature/callingconventions.ll index 5617f9f..d2e9de4 100644 --- a/test/Feature/callingconventions.ll +++ b/test/Feature/callingconventions.ll @@ -1,47 +1,50 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll -fastcc void %foo() { - ret void +define fastcc void @foo() { + ret void } -coldcc void %bar() { - call fastcc void %foo() - ret void +define coldcc void @bar() { + call fastcc void @foo( ) + ret void } -csretcc void %structret({sbyte}* %P) { - call csretcc void %structret({sbyte}* %P) - ret void +define void @structret({ i8 }* sret %P) { + call void @structret( { i8 }* sret %P ) + ret void } - -cc0 void %foo2() { - ret void +define void @foo2() { + ret void } -coldcc void %bar2() { - call fastcc void %foo() - ret void +define coldcc void @bar2() { + call fastcc void @foo( ) + ret void } -cc42 void %bar3() { - invoke fastcc void %foo() to label %Ok unwind label %U -Ok: - ret void -U: - unwind -} +define cc42 void @bar3() { + invoke fastcc void @foo( ) + to label %Ok unwind label %U +Ok: ; preds = %0 + ret void -void %bar4() { - call cc42 void %bar() - invoke cc42 void %bar3() to label %Ok unwind label %U -Ok: - ret void -U: - unwind +U: ; preds = %0 + unwind } +define void @bar4() { + call cc42 void @bar( ) + invoke cc42 void @bar3( ) + to label %Ok unwind label %U + +Ok: ; preds = %0 + ret void + +U: ; preds = %0 + unwind +} diff --git a/test/Feature/calltest.ll b/test/Feature/calltest.ll index f015223..feafd3c 100644 --- a/test/Feature/calltest.ll +++ b/test/Feature/calltest.ll @@ -1,34 +1,32 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll -%FunTy = type int(int) +%FunTy = type i32 (i32) -declare int "test"(int) ; Test forward declaration merging +declare i32 @test(i32) ; Test forward declaration merging -implementation - -void "invoke"(%FunTy *%x) { - %foo = call %FunTy* %x(int 123) - %foo2 = tail call %FunTy* %x(int 123) - ret void +define void @invoke(%FunTy* %x) { + %foo = call i32 %x( i32 123 ) ; <i32> [#uses=0] + %foo2 = tail call i32 %x( i32 123 ) ; <i32> [#uses=0] + ret void } -int "main"(int %argc) ; TODO: , sbyte **argv, sbyte **envp) -begin - %retval = call int (int) *%test(int %argc) - %two = add int %retval, %retval - %retval2 = invoke int %test(int %argc) - to label %Next except label %Error -Next: - %two2 = add int %two, %retval2 - call void %invoke (%FunTy* %test) - ret int %two2 -Error: - ret int -1 -end +define i32 @main(i32 %argc) { + %retval = call i32 @test( i32 %argc ) ; <i32> [#uses=2] + %two = add i32 %retval, %retval ; <i32> [#uses=1] + %retval2 = invoke i32 @test( i32 %argc ) + to label %Next unwind label %Error ; <i32> [#uses=1] + +Next: ; preds = %0 + %two2 = add i32 %two, %retval2 ; <i32> [#uses=1] + call void @invoke( %FunTy* @test ) + ret i32 %two2 -int "test"(int %i0) -begin - ret int %i0 -end +Error: ; preds = %0 + ret i32 -1 +} + +define i32 @test(i32 %i0) { + ret i32 %i0 +} diff --git a/test/Feature/casttest.ll b/test/Feature/casttest.ll index 96f971a..d9c22ff 100644 --- a/test/Feature/casttest.ll +++ b/test/Feature/casttest.ll @@ -1,13 +1,12 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll -short "FunFunc"(long %x, sbyte %z) -begin -bb0: ;;<label> - %cast110 = cast sbyte %z to short ;;<short>:(signed operands) - %cast10 = cast long %x to short ;;<short> - %reg109 = add short %cast110, %cast10 ;;<short> - ret short %reg109 ;;<void> -end +define i16 @FunFunc(i64 %x, i8 %z) { +bb0: + %cast110 = sext i8 %z to i16 ; <i16> [#uses=1] + %cast10 = trunc i64 %x to i16 ; <i16> [#uses=1] + %reg109 = add i16 %cast110, %cast10 ; <i16> [#uses=1] + ret i16 %reg109 +} diff --git a/test/Feature/cfgstructures.ll b/test/Feature/cfgstructures.ll index b16af47..e667f6d 100644 --- a/test/Feature/cfgstructures.ll +++ b/test/Feature/cfgstructures.ll @@ -1,57 +1,53 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll -implementation - ;; This is an irreducible flow graph +define void @irreducible(i1 %cond) { + br i1 %cond, label %X, label %Y +X: ; preds = %Y, %0 + br label %Y -void "irreducible"(bool %cond) -begin - br bool %cond, label %X, label %Y - -X: - br label %Y -Y: - br label %X -end +Y: ; preds = %X, %0 + br label %X +} ;; This is a pair of loops that share the same header +define void @sharedheader(i1 %cond) { + br label %A + +A: ; preds = %Y, %X, %0 + br i1 %cond, label %X, label %Y + +X: ; preds = %A + br label %A -void "sharedheader"(bool %cond) -begin - br label %A -A: - br bool %cond, label %X, label %Y +Y: ; preds = %A + br label %A +} -X: - br label %A -Y: - br label %A -end ;; This is a simple nested loop -void "nested"(bool %cond1, bool %cond2, bool %cond3) -begin - br label %Loop1 +define void @nested(i1 %cond1, i1 %cond2, i1 %cond3) { + br label %Loop1 -Loop1: - br label %Loop2 +Loop1: ; preds = %L2Exit, %0 + br label %Loop2 -Loop2: - br label %Loop3 +Loop2: ; preds = %L3Exit, %Loop1 + br label %Loop3 -Loop3: - br bool %cond3, label %Loop3, label %L3Exit +Loop3: ; preds = %Loop3, %Loop2 + br i1 %cond3, label %Loop3, label %L3Exit -L3Exit: - br bool %cond2, label %Loop2, label %L2Exit +L3Exit: ; preds = %Loop3 + br i1 %cond2, label %Loop2, label %L2Exit -L2Exit: - br bool %cond1, label %Loop1, label %L1Exit +L2Exit: ; preds = %L3Exit + br i1 %cond1, label %Loop1, label %L1Exit -L1Exit: - ret void -end +L1Exit: ; preds = %L2Exit + ret void +} diff --git a/test/Feature/constexpr.ll b/test/Feature/constexpr.ll index aea8944..13e6f36 100644 --- a/test/Feature/constexpr.ll +++ b/test/Feature/constexpr.ll @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll @@ -10,20 +10,20 @@ ;; Test constant cast expressions ;;------------------------------- -global ulong u0x00001 ; hexadecimal unsigned integer constants -global long s0x0012312 ; hexadecimal signed integer constants +global i64 u0x00001 ; hexadecimal unsigned integer constants +global i64 s0x0012312 ; hexadecimal signed integer constants -%t2 = global int* %t1 ;; Forward reference without cast -%t3 = global uint* cast (int* %t1 to uint*) ;; Forward reference with cast -%t1 = global int 4 ;; int* %0 -%t4 = global int** cast (uint** %t3 to int**) ;; Cast of a previous cast -%t5 = global uint** %t3 ;; Reference to a previous cast -%t6 = global int*** %t4 ;; Different ref. to a previous cast -%t7 = global float* cast (int 12345678 to float*) ;; Cast ordinary value to ptr -%t9 = global int cast (float cast (int 8 to float) to int) ;; Nested cast expression +@t2 = global i32* @t1 ;; Forward reference without cast +@t3 = global i32* bitcast (i32* @t1 to i32*) ;; Forward reference with cast +@t1 = global i32 4 ;; i32* @0 +@t4 = global i32** bitcast (i32** @t3 to i32**) ;; Cast of a previous cast +@t5 = global i32** @t3 ;; Reference to a previous cast +@t6 = global i32*** @t4 ;; Different ref. to a previous cast +@t7 = global float* inttoptr (i32 12345678 to float*) ;; Cast ordinary value to ptr +@t9 = global i32 bitcast (float bitcast (i32 8 to float) to i32) ;; Nested cast expression -global int* cast (float* %0 to int*) ;; Forward numeric reference -global float* %0 ;; Duplicate forward numeric reference +global i32* bitcast (float* @4 to i32*) ;; Forward numeric reference +global float* @4 ;; Duplicate forward numeric reference global float 0.0 @@ -31,53 +31,50 @@ global float 0.0 ;; Test constant getelementpr expressions for arrays ;;--------------------------------------------------- -%array = constant [2 x int] [ int 12, int 52 ] -%arrayPtr = global int* getelementptr ([2 x int]* %array, long 0, long 0) ;; int* &%array[0][0] -%arrayPtr5 = global int** getelementptr (int** %arrayPtr, long 5) ;; int* &%arrayPtr[5] +@array = constant [2 x i32] [ i32 12, i32 52 ] +@arrayPtr = global i32* getelementptr ([2 x i32]* @array, i64 0, i64 0) ;; i32* &@array[0][0] +@arrayPtr5 = global i32** getelementptr (i32** @arrayPtr, i64 5) ;; i32* &@arrayPtr[5] -%somestr = constant [11x sbyte] c"hello world" -%char5 = global sbyte* getelementptr([11x sbyte]* %somestr, long 0, long 5) +@somestr = constant [11x i8] c"hello world" +@char5 = global i8* getelementptr([11x i8]* @somestr, i64 0, i64 5) ;; cast of getelementptr -%char8a = global int* cast (sbyte* getelementptr([11x sbyte]* %somestr, long 0, long 8) to int*) +@char8a = global i32* bitcast (i8* getelementptr([11x i8]* @somestr, i64 0, i64 8) to i32*) ;; getelementptr containing casts -%char8b = global sbyte* getelementptr([11x sbyte]* %somestr, long cast (ubyte 0 to long), long cast (sbyte 8 to long)) +@char8b = global i8* getelementptr([11x i8]* @somestr, i64 sext (i8 0 to i64), i64 sext (i8 8 to i64)) ;;------------------------------------------------------- ;; TODO: Test constant getelementpr expressions for structures ;;------------------------------------------------------- -%SType = type { int , {float, {ubyte} }, ulong } ;; struct containing struct -%SAType = type { int , {[2x float], ulong} } ;; struct containing array +%SType = type { i32 , {float, {i8} }, i64 } ;; struct containing struct +%SAType = type { i32 , {[2x float], i64} } ;; struct containing array -%S1 = global %SType* null ;; Global initialized to NULL -%S2c = constant %SType { int 1, {float,{ubyte}} {float 2.0, {ubyte} {ubyte 3}}, ulong 4} +@S1 = global %SType* null ;; Global initialized to NULL +@S2c = constant %SType { i32 1, {float,{i8}} {float 2.0, {i8} {i8 3}}, i64 4} -%S3c = constant %SAType { int 1, {[2x float], ulong} {[2x float] [float 2.0, float 3.0], ulong 4} } +@S3c = constant %SAType { i32 1, {[2x float], i64} {[2x float] [float 2.0, float 3.0], i64 4} } -%S1ptr = global %SType** %S1 ;; Ref. to global S1 -%S2 = global %SType* %S2c ;; Ref. to constant S2 -%S3 = global %SAType* %S3c ;; Ref. to constant S3 +@S1ptr = global %SType** @S1 ;; Ref. to global S1 +@S2 = global %SType* @S2c ;; Ref. to constant S2 +@S3 = global %SAType* @S3c ;; Ref. to constant S3 - ;; Pointer to float (**%S1).1.0 -%S1fld1a = global float* getelementptr (%SType* %S2c, long 0, uint 1, uint 0) + ;; Pointer to float (**@S1).1.0 +@S1fld1a = global float* getelementptr (%SType* @S2c, i64 0, i32 1, i32 0) ;; Another ptr to the same! -%S1fld1b = global float* getelementptr (%SType* %S2c, long 0, uint 1, uint 0) +@S1fld1b = global float* getelementptr (%SType* @S2c, i64 0, i32 1, i32 0) -%S1fld1bptr = global float** %S1fld1b ;; Ref. to previous pointer +@S1fld1bptr = global float** @S1fld1b ;; Ref. to previous pointer - ;; Pointer to ubyte (**%S2).1.1.0 -%S2fld3 = global ubyte* getelementptr (%SType* %S2c, long 0, uint 1, uint 1, uint 0) + ;; Pointer to i8 (**@S2).1.1.0 +@S2fld3 = global i8* getelementptr (%SType* @S2c, i64 0, i32 1, i32 1, i32 0) - ;; Pointer to float (**%S2).1.0[0] -;%S3fld3 = global float* getelementptr (%SAType** %S3, long 0, long 0, uint 1, uint 0, long 0) + ;; Pointer to float (**@S2).1.0[0] +;@S3fld3 = global float* getelementptr (%SAType** @S3, i64 0, i64 0, i32 1, i32 0, i64 0) ;;--------------------------------------------------------- ;; TODO: Test constant expressions for unary and binary operators ;;--------------------------------------------------------- ;;--------------------------------------------------- - -implementation - diff --git a/test/Feature/constpointer.ll b/test/Feature/constpointer.ll index d1dddaa..5c1bed1 100644 --- a/test/Feature/constpointer.ll +++ b/test/Feature/constpointer.ll @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll @@ -10,24 +10,22 @@ ; -%t3 = global int * %t1 ;; Forward reference -%t1 = global int 4 -%t4 = global int ** %t3 ;; reference to reference +@t3 = global i32* @t1 ;; Forward reference +@t1 = global i32 4 +@t4 = global i32** @t3 ;; reference to reference -%t2 = global int * %t1 +@t2 = global i32* @t1 -global float * %0 ;; Forward numeric reference -global float * %0 ;; Duplicate forward numeric reference +global float * @2 ;; Forward numeric reference +global float * @2 ;; Duplicate forward numeric reference global float 0.0 -global float * %0 ;; Numeric reference +global float * @2 ;; Numeric reference -%fptr = global void() * %f ;; Forward ref method defn -declare void "f"() ;; External method +@fptr = global void() * @f ;; Forward ref method defn +declare void @f() ;; External method -%sptr1 = global [11x sbyte]* %somestr ;; Forward ref to a constant -%somestr = constant [11x sbyte] c"hello world" -%sptr2 = global [11x sbyte]* %somestr - -implementation +@sptr1 = global [11x i8]* @somestr ;; Forward ref to a constant +@somestr = constant [11x i8] c"hello world" +@sptr2 = global [11x i8]* @somestr diff --git a/test/Feature/escaped_label.ll b/test/Feature/escaped_label.ll index 4532fe9..7f5f619 100644 --- a/test/Feature/escaped_label.ll +++ b/test/Feature/escaped_label.ll @@ -1,10 +1,11 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll +define i32 @foo() { + br label %"foo`~!@#$%^&*()-_=+{}[]\\\\|;:',<.>/?" -int %foo() { - br label "foo`~!@#$%^&*()-_=+{}[]\\|;:',<.>/?" -"foo`~!@#$%^&*()-_=+{}[]\\|;:',<.>/?": - ret int 17 +"foo`~!@#$%^&*()-_=+{}[]\\\\|;:',<.>/?": ; preds = %0 + ret i32 17 } + diff --git a/test/Feature/float.ll b/test/Feature/float.ll index c1532eb..632cfb7 100644 --- a/test/Feature/float.ll +++ b/test/Feature/float.ll @@ -1,6 +1,6 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > t1.ll +; RUN: llvm-as < %s | llvm-dis > t1.ll ; RUN: llvm-as t1.ll -o - | llvm-dis > t2.ll ; RUN: diff t1.ll t2.ll -%F1 = global float 0x4010000000000000 -%D1 = global double 0x4010000000000000 +@F1 = global float 0x4010000000000000 +@D1 = global double 0x4010000000000000 diff --git a/test/Feature/fold-fpcast.ll b/test/Feature/fold-fpcast.ll index 66e972b..cdf8da6 100644 --- a/test/Feature/fold-fpcast.ll +++ b/test/Feature/fold-fpcast.ll @@ -1,18 +1,18 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis | not grep bitcast +; RUN: llvm-as < %s | llvm-dis | not grep bitcast -int %test1() { - ret int bitcast(float 0x400D9999A0000000 to int) +define i32 @test1() { + ret i32 bitcast(float 0x400D9999A0000000 to i32) } -float %test2() { - ret float bitcast(int 17 to float) +define float @test2() { + ret float bitcast(i32 17 to float) } -long %test3() { - ret long bitcast (double 0x400921FB4D12D84A to long) +define i64 @test3() { + ret i64 bitcast (double 0x400921FB4D12D84A to i64) } -double %test4() { - ret double bitcast (long 42 to double) +define double @test4() { + ret double bitcast (i64 42 to double) } diff --git a/test/Feature/forwardreftest.ll b/test/Feature/forwardreftest.ll index edb1f28..26d214a 100644 --- a/test/Feature/forwardreftest.ll +++ b/test/Feature/forwardreftest.ll @@ -1,34 +1,29 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll - %myty = type int - %myfn = type float (int,double,uint,short) - type int(%myfn*) - type int(int) - type int(int(int)*) +%myty = type i32 +%myfn = type float (i32,double,i32,i16) +type i32(%myfn*) +type i32(i32) +type i32(i32(i32)*) - %thisfuncty = type int (int) * -implementation + %thisfuncty = type i32 (i32) * -declare void %F(%thisfuncty, %thisfuncty, %thisfuncty) +declare void @F(%thisfuncty, %thisfuncty, %thisfuncty) -; This function always returns zero -int %zarro(int %Func) -begin +define i32 @zarro(i32 %Func) { Startup: - add int 0, 10 - ret int 0 -end + add i32 0, 10 ; <i32>:0 [#uses=0] + ret i32 0 +} -int %test(int) -begin - call void %F(%thisfuncty %zarro, %thisfuncty %test, %thisfuncty %foozball) - ret int 0 -end +define i32 @test(i32) { + call void @F( %thisfuncty @zarro, %thisfuncty @test, %thisfuncty @foozball ) + ret i32 0 +} -int %foozball(int) -begin - ret int 0 -end +define i32 @foozball(i32) { + ret i32 0 +} diff --git a/test/Feature/global_section.ll b/test/Feature/global_section.ll index 08a2c32..b8f5eb1 100644 --- a/test/Feature/global_section.ll +++ b/test/Feature/global_section.ll @@ -1,10 +1,10 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll -%X = global int 4, section "foo", align 16 +@X = global i32 4, section "foo", align 16 ; <i32*> [#uses=0] -void %test() section "bar" { - ret void +define void @test() section "bar" { + ret void } diff --git a/test/Feature/globalredefinition.ll b/test/Feature/globalredefinition.ll index 642c093..42e2d1a 100644 --- a/test/Feature/globalredefinition.ll +++ b/test/Feature/globalredefinition.ll @@ -1,18 +1,18 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll ; Test forward references and redefinitions of globals -%A = global int* %B -%B = global int 7 +@A = global i32* @B ; <i32**> [#uses=0] +@B = global i32 7 ; <i32*> [#uses=1] -declare void %X() +declare void @X() -declare void %X() +declare void @X() -void %X() { +define void @X() { ret void } -declare void %X() +declare void @X() diff --git a/test/Feature/globalredefinition2.ll b/test/Feature/globalredefinition2.ll deleted file mode 100644 index 9949e05..0000000 --- a/test/Feature/globalredefinition2.ll +++ /dev/null @@ -1,6 +0,0 @@ -; Test that redefinitions of globals produces an error in llvm-upgrade -; RUN: llvm-upgrade < %s -o /dev/null -f |& grep \ -; RUN: "Renaming global variable 'B' to.*linkage errors" - -%B = global int 7 -%B = global int 7 diff --git a/test/Feature/globalvars.ll b/test/Feature/globalvars.ll index 26259da..9a23775 100644 --- a/test/Feature/globalvars.ll +++ b/test/Feature/globalvars.ll @@ -1,26 +1,18 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll - -%MyVar = uninitialized global int -%MyIntList = uninitialized global { \2 *, int } - external global int ; int*:0 - -%AConst = constant int 123 - -%AString = constant [4 x ubyte] c"test" - -%ZeroInit = global { [100 x int ], [40 x float ] } { [100 x int] zeroinitializer, - [40 x float] zeroinitializer } - -implementation - -int "foo"(int %blah) -begin - store int 5, int *%MyVar - %idx = getelementptr { \2 *, int } * %MyIntList, long 0, uint 1 - store int 12, int* %idx - ret int %blah -end +@MyVar = external global i32 ; <i32*> [#uses=1] +@MyIntList = external global { \2*, i32 } ; <{ \2*, i32 }*> [#uses=1] +external global i32 ; <i32*>:0 [#uses=0] +@AConst = constant i32 123 ; <i32*> [#uses=0] +@AString = constant [4 x i8] c"test" ; <[4 x i8]*> [#uses=0] +@ZeroInit = global { [100 x i32], [40 x float] } zeroinitializer ; <{ [100 x i32], [40 x float] }*> [#uses=0] + +define i32 @foo(i32 %blah) { + store i32 5, i32* @MyVar + %idx = getelementptr { \2*, i32 }* @MyIntList, i64 0, i32 1 ; <i32*> [#uses=1] + store i32 12, i32* %idx + ret i32 %blah +} diff --git a/test/Feature/indirectcall.ll b/test/Feature/indirectcall.ll index 2d1855b..c1cf39f 100644 --- a/test/Feature/indirectcall.ll +++ b/test/Feature/indirectcall.ll @@ -1,54 +1,49 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll -implementation - -declare int "atoi"(sbyte *) - -ulong "fib"(ulong %n) -begin - setlt ulong %n, 2 ; {bool}:0 - br bool %0, label %BaseCase, label %RecurseCase - -BaseCase: - ret ulong 1 - -RecurseCase: - %n2 = sub ulong %n, 2 - %n1 = sub ulong %n, 1 - %f2 = call ulong(ulong) * %fib(ulong %n2) - %f1 = call ulong(ulong) * %fib(ulong %n1) - %result = add ulong %f2, %f1 - ret ulong %result -end - -ulong "realmain"(int %argc, sbyte ** %argv) -begin - seteq int %argc, 2 ; {bool}:0 - br bool %0, label %HasArg, label %Continue -HasArg: - ; %n1 = atoi(argv[1]) - %n1 = add int 1, 1 - br label %Continue - -Continue: - %n = phi int [%n1, %HasArg], [1, %0] - %N = cast int %n to ulong - %F = call ulong(ulong) *%fib(ulong %N) - ret ulong %F -end - -ulong "trampoline"(ulong %n, ulong(ulong)* %fibfunc) -begin - %F = call ulong(ulong) *%fibfunc(ulong %n) - ret ulong %F -end - -int "main"() -begin - %Result = call ulong %trampoline(ulong 10, ulong(ulong) *%fib) - %Result = cast ulong %Result to int - ret int %Result -end +declare i32 @atoi(i8*) + +define i64 @fib(i64 %n) { + icmp ult i64 %n, 2 ; <i1>:1 [#uses=1] + br i1 %1, label %BaseCase, label %RecurseCase + +BaseCase: ; preds = %0 + ret i64 1 + +RecurseCase: ; preds = %0 + %n2 = sub i64 %n, 2 ; <i64> [#uses=1] + %n1 = sub i64 %n, 1 ; <i64> [#uses=1] + %f2 = call i64 @fib( i64 %n2 ) ; <i64> [#uses=1] + %f1 = call i64 @fib( i64 %n1 ) ; <i64> [#uses=1] + %result = add i64 %f2, %f1 ; <i64> [#uses=1] + ret i64 %result +} + +define i64 @realmain(i32 %argc, i8** %argv) { +; <label>:0 + icmp eq i32 %argc, 2 ; <i1>:1 [#uses=1] + br i1 %1, label %HasArg, label %Continue + +HasArg: ; preds = %0 + %n1 = add i32 1, 1 ; <i32> [#uses=1] + br label %Continue + +Continue: ; preds = %HasArg, %0 + %n = phi i32 [ %n1, %HasArg ], [ 1, %0 ] ; <i32> [#uses=1] + %N = sext i32 %n to i64 ; <i64> [#uses=1] + %F = call i64 @fib( i64 %N ) ; <i64> [#uses=1] + ret i64 %F +} + +define i64 @trampoline(i64 %n, i64 (i64)* %fibfunc) { + %F = call i64 %fibfunc( i64 %n ) ; <i64> [#uses=1] + ret i64 %F +} + +define i32 @main() { + %Result = call i64 @trampoline( i64 10, i64 (i64)* @fib ) ; <i64> [#uses=1] + %Result.upgrd.1 = trunc i64 %Result to i32 ; <i32> [#uses=1] + ret i32 %Result.upgrd.1 +} diff --git a/test/Feature/indirectcall2.ll b/test/Feature/indirectcall2.ll index d16c737..1b949fc 100644 --- a/test/Feature/indirectcall2.ll +++ b/test/Feature/indirectcall2.ll @@ -1,25 +1,22 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll -implementation +define i64 @test(i64 %X) { + ret i64 %X +} -ulong "test"(ulong %X) -begin - ret ulong %X -end +define i64 @fib(i64 %n) { +; <label>:0 + %T = icmp ult i64 %n, 2 ; <i1> [#uses=1] + br i1 %T, label %BaseCase, label %RecurseCase -ulong "fib"(ulong %n) -begin - %T = setlt ulong %n, 2 ; {bool}:0 - br bool %T, label %BaseCase, label %RecurseCase +RecurseCase: ; preds = %0 + %result = call i64 @test( i64 %n ) ; <i64> [#uses=0] + br label %BaseCase -RecurseCase: - %result = call ulong %test(ulong %n) - br label %BaseCase - -BaseCase: - %X = phi ulong [1, %0], [2, %RecurseCase] - ret ulong %X -end +BaseCase: ; preds = %RecurseCase, %0 + %X = phi i64 [ 1, %0 ], [ 2, %RecurseCase ] ; <i64> [#uses=1] + ret i64 %X +} diff --git a/test/Feature/inlineasm.ll b/test/Feature/inlineasm.ll index fdb4657..e4318f7 100644 --- a/test/Feature/inlineasm.ll +++ b/test/Feature/inlineasm.ll @@ -1,14 +1,13 @@ -; RUN: llvm-upgrade %s -o - | llvm-as -o /dev/null -f -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > t1.ll +; RUN: llvm-as < %s | llvm-dis > t1.ll ; RUN: llvm-as t1.ll -o - | llvm-dis > t2.ll ; RUN: diff t1.ll t2.ll - module asm "this is an inline asm block" module asm "this is another inline asm block" -int %test() { - %X = call int asm "tricky here $0, $1", "=r,r"(int 4) - call void asm sideeffect "eieio", ""() - ret int %X +define i32 @test() { + %X = call i32 asm "tricky here $0, $1", "=r,r"( i32 4 ) ; <i32> [#uses=1] + call void asm sideeffect "eieio", ""( ) + ret i32 %X } + diff --git a/test/Feature/instructions.ll b/test/Feature/instructions.ll index 6867491..d0c303d 100644 --- a/test/Feature/instructions.ll +++ b/test/Feature/instructions.ll @@ -1,25 +1,24 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll -uint %test_extractelement(<4 x uint> %V) { - %R = extractelement <4 x uint> %V, uint 1 - ret uint %R +define i32 @test_extractelement(<4 x i32> %V) { + %R = extractelement <4 x i32> %V, i32 1 ; <i32> [#uses=1] + ret i32 %R } -<4 x uint> %test_insertelement(<4 x uint> %V) { - %R = insertelement <4 x uint> %V, uint 0, uint 0 - ret <4 x uint> %R +define <4 x i32> @test_insertelement(<4 x i32> %V) { + %R = insertelement <4 x i32> %V, i32 0, i32 0 ; <<4 x i32>> [#uses=1] + ret <4 x i32> %R } -<4 x uint> %test_shufflevector_u(<4 x uint> %V) { - %R = shufflevector <4 x uint> %V, <4 x uint> %V, - <4 x uint> < uint 1, uint undef, uint 7, uint 2> - ret <4 x uint> %R +define <4 x i32> @test_shufflevector_u(<4 x i32> %V) { + %R = shufflevector <4 x i32> %V, <4 x i32> %V, <4 x i32> < i32 1, i32 undef, i32 7, i32 2 > ; <<4 x i32>> [#uses=1] + ret <4 x i32> %R } -<4 x float> %test_shufflevector_f(<4 x float> %V) { - %R = shufflevector <4 x float> %V, <4 x float> undef, - <4 x uint> < uint 1, uint undef, uint 7, uint 2> +define <4 x float> @test_shufflevector_f(<4 x float> %V) { + %R = shufflevector <4 x float> %V, <4 x float> undef, <4 x i32> < i32 1, i32 undef, i32 7, i32 2 > ; <<4 x float>> [#uses=1] ret <4 x float> %R } + diff --git a/test/Feature/intrinsics.ll b/test/Feature/intrinsics.ll index d464726..60c0343 100644 --- a/test/Feature/intrinsics.ll +++ b/test/Feature/intrinsics.ll @@ -1,59 +1,62 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll +declare i1 @llvm.isunordered.f32(float, float) -declare bool %llvm.isunordered.f32(float,float) -declare bool %llvm.isunordered.f64(double,double) +declare i1 @llvm.isunordered.f64(double, double) -declare void %llvm.prefetch(sbyte*, uint, uint) +declare void @llvm.prefetch(i8*, i32, i32) -declare uint %llvm.ctpop.i8(ubyte) -declare uint %llvm.ctpop.i16(ushort) -declare uint %llvm.ctpop.i32(uint) -declare uint %llvm.ctpop.i64(ulong) +declare i32 @llvm.ctpop.i8(i8) -declare uint %llvm.cttz.i8(ubyte) -declare uint %llvm.cttz.i16(ushort) -declare uint %llvm.cttz.i32(uint) -declare uint %llvm.cttz.i64(ulong) +declare i32 @llvm.ctpop.i16(i16) -declare uint %llvm.ctlz.i8(ubyte) -declare uint %llvm.ctlz.i16(ushort) -declare uint %llvm.ctlz.i32(uint) -declare uint %llvm.ctlz.i64(ulong) +declare i32 @llvm.ctpop.i32(i32) -declare float %llvm.sqrt.f32(float) -declare double %llvm.sqrt.f64(double) +declare i32 @llvm.ctpop.i64(i64) -implementation +declare i32 @llvm.cttz.i8(i8) + +declare i32 @llvm.cttz.i16(i16) + +declare i32 @llvm.cttz.i32(i32) + +declare i32 @llvm.cttz.i64(i64) + +declare i32 @llvm.ctlz.i8(i8) + +declare i32 @llvm.ctlz.i16(i16) + +declare i32 @llvm.ctlz.i32(i32) + +declare i32 @llvm.ctlz.i64(i64) + +declare float @llvm.sqrt.f32(float) + +declare double @llvm.sqrt.f64(double) ; Test llvm intrinsics ; -void %libm() { - call bool %llvm.isunordered.f32(float 1.0, float 2.0) - call bool %llvm.isunordered.f64(double 3.0, double 4.0) - - call void %llvm.prefetch(sbyte* null, uint 1, uint 3) - - call float %llvm.sqrt.f32(float 5.0) - call double %llvm.sqrt.f64(double 6.0) - - call uint %llvm.ctpop.i8(ubyte 10) - call uint %llvm.ctpop.i16(ushort 11) - call uint %llvm.ctpop.i32(uint 12) - call uint %llvm.ctpop.i64(ulong 13) - - call uint %llvm.ctlz.i8(ubyte 14) - call uint %llvm.ctlz.i16(ushort 15) - call uint %llvm.ctlz.i32(uint 16) - call uint %llvm.ctlz.i64(ulong 17) - - call uint %llvm.cttz.i8(ubyte 18) - call uint %llvm.cttz.i16(ushort 19) - call uint %llvm.cttz.i32(uint 20) - call uint %llvm.cttz.i64(ulong 21) - ret void +define void @libm() { + fcmp uno float 1.000000e+00, 2.000000e+00 ; <i1>:1 [#uses=0] + fcmp uno double 3.000000e+00, 4.000000e+00 ; <i1>:2 [#uses=0] + call void @llvm.prefetch( i8* null, i32 1, i32 3 ) + call float @llvm.sqrt.f32( float 5.000000e+00 ) ; <float>:3 [#uses=0] + call double @llvm.sqrt.f64( double 6.000000e+00 ) ; <double>:4 [#uses=0] + call i32 @llvm.ctpop.i8( i8 10 ) ; <i32>:5 [#uses=0] + call i32 @llvm.ctpop.i16( i16 11 ) ; <i32>:6 [#uses=0] + call i32 @llvm.ctpop.i32( i32 12 ) ; <i32>:7 [#uses=0] + call i32 @llvm.ctpop.i64( i64 13 ) ; <i32>:8 [#uses=0] + call i32 @llvm.ctlz.i8( i8 14 ) ; <i32>:9 [#uses=0] + call i32 @llvm.ctlz.i16( i16 15 ) ; <i32>:10 [#uses=0] + call i32 @llvm.ctlz.i32( i32 16 ) ; <i32>:11 [#uses=0] + call i32 @llvm.ctlz.i64( i64 17 ) ; <i32>:12 [#uses=0] + call i32 @llvm.cttz.i8( i8 18 ) ; <i32>:13 [#uses=0] + call i32 @llvm.cttz.i16( i16 19 ) ; <i32>:14 [#uses=0] + call i32 @llvm.cttz.i32( i32 20 ) ; <i32>:15 [#uses=0] + call i32 @llvm.cttz.i64( i64 21 ) ; <i32>:16 [#uses=0] + ret void } ; FIXME: test ALL the intrinsics in this file. diff --git a/test/Feature/opaquetypes.ll b/test/Feature/opaquetypes.ll index 92efaeb..2ca58a7 100644 --- a/test/Feature/opaquetypes.ll +++ b/test/Feature/opaquetypes.ll @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll @@ -6,10 +6,10 @@ ; and recursive types. Oh my. ; -%SQ1 = type { int } +%SQ1 = type { i32 } %ITy = type opaque %SQ2 = type { %ITy } -%ITy = type int +%ITy = type i32 %CCC = type { \2* } @@ -23,10 +23,10 @@ type %BBB ; Test simple opaque type resolution... %intty = type opaque -%intty = type int +%intty = type i32 ; Perform a simple forward reference... -%ty1 = type { %ty2, int } +%ty1 = type { %ty2, i32 } %ty2 = type float ; Do a recursive type... @@ -55,7 +55,3 @@ type %BBB %Y1 = type { { \3 * }, \2 * } %Z1 = type { { \3 * }, [12x\3] *, { { { \5 * } } } } -implementation - - - diff --git a/test/Feature/packed.ll b/test/Feature/packed.ll index a8d9370..b86a227 100644 --- a/test/Feature/packed.ll +++ b/test/Feature/packed.ll @@ -1,17 +1,15 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll -%foo1 = uninitialized global <4 x float>; -%foo2 = uninitialized global <2 x int>; +@foo1 = external global <4 x float> ; <<4 x float>*> [#uses=2] +@foo2 = external global <2 x i32> ; <<2 x i32>*> [#uses=2] -implementation ; Functions: - -void %main() -{ - store <4 x float> <float 1.0, float 2.0, float 3.0, float 4.0>, <4 x float>* %foo1 - store <2 x int> <int 4, int 4>, <2 x int>* %foo2 - %l1 = load <4 x float>* %foo1 - %l2 = load <2 x int>* %foo2 +define void @main() { + store <4 x float> < float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00 >, <4 x float>* @foo1 + store <2 x i32> < i32 4, i32 4 >, <2 x i32>* @foo2 + %l1 = load <4 x float>* @foo1 ; <<4 x float>> [#uses=0] + %l2 = load <2 x i32>* @foo2 ; <<2 x i32>> [#uses=0] ret void } + diff --git a/test/Feature/properties.ll b/test/Feature/properties.ll index e906f22..c688d68 100644 --- a/test/Feature/properties.ll +++ b/test/Feature/properties.ll @@ -1,10 +1,7 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll - -target endian = little -target pointersize = 32 +target datalayout = "e-p:32:32" target triple = "proc-vend-sys" deplibs = [ "m", "c" ] - diff --git a/test/Feature/prototype.ll b/test/Feature/prototype.ll index 9bab73f..3754a1d 100644 --- a/test/Feature/prototype.ll +++ b/test/Feature/prototype.ll @@ -1,14 +1,11 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll -implementation +declare i32 @bar(i32) -declare int "bar"(int %in) - -int "foo"(int %blah) -begin - %xx = call int %bar(int %blah) - ret int %xx -end +define i32 @foo(i32 %blah) { + %xx = call i32 @bar( i32 %blah ) ; <i32> [#uses=1] + ret i32 %xx +} diff --git a/test/Feature/recursivetype.ll b/test/Feature/recursivetype.ll index 9ea3484..43db5f0 100644 --- a/test/Feature/recursivetype.ll +++ b/test/Feature/recursivetype.ll @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll @@ -37,72 +37,67 @@ ; if (FindData(MyList, 700)) foundIt(); ; } -%list = type { %list*, int } +%list = type { %list*, i32 } -declare sbyte *"malloc"(uint) +declare i8* @malloc(i32) -;;********************** -implementation -;;********************** - -void "InsertIntoListTail"(%list** %L, int %Data) -begin +define void @InsertIntoListTail(%list** %L, i32 %Data) { bb1: - %reg116 = load %list** %L ;;<%list*> - %cast1004 = cast ulong 0 to %list* ;;<%list*> - %cond1000 = seteq %list* %reg116, %cast1004 ;;<bool> - br bool %cond1000, label %bb3, label %bb2 + %reg116 = load %list** %L ; <%list*> [#uses=1] + %cast1004 = inttoptr i64 0 to %list* ; <%list*> [#uses=1] + %cond1000 = icmp eq %list* %reg116, %cast1004 ; <i1> [#uses=1] + br i1 %cond1000, label %bb3, label %bb2 -bb2: - %reg117 = phi %list** [ %reg118, %bb2 ], [ %L, %bb1 ] ;;<%list**> - %cast1010 = cast %list** %reg117 to %list*** ;;<%list***> - %reg118 = load %list*** %cast1010 ;;<%list**> - %reg109 = load %list** %reg118 ;;<%list*> - %cast1005 = cast ulong 0 to %list* ;;<%list*> - %cond1001 = setne %list* %reg109, %cast1005 ;;<bool> - br bool %cond1001, label %bb2, label %bb3 +bb2: ; preds = %bb2, %bb1 + %reg117 = phi %list** [ %reg118, %bb2 ], [ %L, %bb1 ] ; <%list**> [#uses=1] + %cast1010 = bitcast %list** %reg117 to %list*** ; <%list***> [#uses=1] + %reg118 = load %list*** %cast1010 ; <%list**> [#uses=3] + %reg109 = load %list** %reg118 ; <%list*> [#uses=1] + %cast1005 = inttoptr i64 0 to %list* ; <%list*> [#uses=1] + %cond1001 = icmp ne %list* %reg109, %cast1005 ; <i1> [#uses=1] + br i1 %cond1001, label %bb2, label %bb3 -bb3: - %reg119 = phi %list** [ %reg118, %bb2 ], [ %L, %bb1 ] ;;<%list**> - %cast1006 = cast %list** %reg119 to sbyte** ;;<sbyte**> - %reg111 = call sbyte* %malloc(uint 16) ;;<sbyte*> - store sbyte* %reg111, sbyte** %cast1006 ;;<void> - %reg111 = cast sbyte* %reg111 to ulong - %reg1002 = add ulong %reg111, 8 - %reg1002 = cast ulong %reg1002 to sbyte* ;;<sbyte*> - %cast1008 = cast sbyte* %reg1002 to int* ;;<int*> - store int %Data, int* %cast1008 ;;<void> - %cast1003 = cast ulong 0 to ulong* ;;<ulong*> - %cast1009 = cast sbyte* %reg111 to ulong** ;;<ulong**> - store ulong* %cast1003, ulong** %cast1009 ;;<void> +bb3: ; preds = %bb2, %bb1 + %reg119 = phi %list** [ %reg118, %bb2 ], [ %L, %bb1 ] ; <%list**> [#uses=1] + %cast1006 = bitcast %list** %reg119 to i8** ; <i8**> [#uses=1] + %reg111 = call i8* @malloc( i32 16 ) ; <i8*> [#uses=3] + store i8* %reg111, i8** %cast1006 + %reg111.upgrd.1 = ptrtoint i8* %reg111 to i64 ; <i64> [#uses=1] + %reg1002 = add i64 %reg111.upgrd.1, 8 ; <i64> [#uses=1] + %reg1002.upgrd.2 = inttoptr i64 %reg1002 to i8* ; <i8*> [#uses=1] + %cast1008 = bitcast i8* %reg1002.upgrd.2 to i32* ; <i32*> [#uses=1] + store i32 %Data, i32* %cast1008 + %cast1003 = inttoptr i64 0 to i64* ; <i64*> [#uses=1] + %cast1009 = bitcast i8* %reg111 to i64** ; <i64**> [#uses=1] + store i64* %cast1003, i64** %cast1009 ret void -end +} -%list* "FindData"(%list* %L, int %Data) -begin +define %list* @FindData(%list* %L, i32 %Data) { bb1: br label %bb2 -bb2: - %reg115 = phi %list* [ %reg116, %bb6 ], [ %L, %bb1 ] ;;<%list*> - %cast1014 = cast ulong 0 to %list* ;;<%list*> - %cond1011 = setne %list* %reg115, %cast1014 ;;<bool> - br bool %cond1011, label %bb4, label %bb3 +bb2: ; preds = %bb6, %bb1 + %reg115 = phi %list* [ %reg116, %bb6 ], [ %L, %bb1 ] ; <%list*> [#uses=4] + %cast1014 = inttoptr i64 0 to %list* ; <%list*> [#uses=1] + %cond1011 = icmp ne %list* %reg115, %cast1014 ; <i1> [#uses=1] + br i1 %cond1011, label %bb4, label %bb3 -bb3: +bb3: ; preds = %bb2 ret %list* null -bb4: - %idx = getelementptr %list* %reg115, long 0, uint 1 ;;<int> - %reg111 = load int* %idx - %cond1013 = setne int %reg111, %Data ;;<bool> - br bool %cond1013, label %bb6, label %bb5 +bb4: ; preds = %bb2 + %idx = getelementptr %list* %reg115, i64 0, i32 1 ; <i32*> [#uses=1] + %reg111 = load i32* %idx ; <i32> [#uses=1] + %cond1013 = icmp ne i32 %reg111, %Data ; <i1> [#uses=1] + br i1 %cond1013, label %bb6, label %bb5 -bb5: +bb5: ; preds = %bb4 ret %list* %reg115 -bb6: - %idx2 = getelementptr %list* %reg115, long 0, uint 0 ;;<%list*> - %reg116 = load %list** %idx2 +bb6: ; preds = %bb4 + %idx2 = getelementptr %list* %reg115, i64 0, i32 0 ; <%list**> [#uses=1] + %reg116 = load %list** %idx2 ; <%list*> [#uses=1] br label %bb2 -end +} + diff --git a/test/Feature/simplecalltest.ll b/test/Feature/simplecalltest.ll index 6f0b72e..6452286 100644 --- a/test/Feature/simplecalltest.ll +++ b/test/Feature/simplecalltest.ll @@ -1,29 +1,24 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll -%FunTy = type int(int) + %FunTy = type i32 (i32) -implementation +define void @invoke(%FunTy* %x) { + %foo = call i32 %x( i32 123 ) ; <i32> [#uses=0] + ret void +} -void "invoke"(%FunTy *%x) -begin - %foo = call %FunTy* %x(int 123) - ret void -end +define i32 @main(i32 %argc, i8** %argv, i8** %envp) { + %retval = call i32 @test( i32 %argc ) ; <i32> [#uses=2] + %two = add i32 %retval, %retval ; <i32> [#uses=1] + %retval2 = call i32 @test( i32 %argc ) ; <i32> [#uses=1] + %two2 = add i32 %two, %retval2 ; <i32> [#uses=1] + call void @invoke( %FunTy* @test ) + ret i32 %two2 +} -int "main"(int %argc, sbyte **%argv, sbyte **%envp) -begin - %retval = call int (int) *%test(int %argc) - %two = add int %retval, %retval - %retval2 = call int %test(int %argc) +define i32 @test(i32 %i0) { + ret i32 %i0 +} - %two2 = add int %two, %retval2 - call void %invoke (%FunTy* %test) - ret int %two2 -end - -int "test"(int %i0) -begin - ret int %i0 -end diff --git a/test/Feature/small.ll b/test/Feature/small.ll index 6ef37c7..4644f64 100644 --- a/test/Feature/small.ll +++ b/test/Feature/small.ll @@ -1,14 +1,11 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll -%x = type int +%x = type i32 -implementation - -int "foo"(int %in) -begin -label: - ret int 2 -end +define i32 @foo(i32 %in) { +label: + ret i32 2 +} diff --git a/test/Feature/smallest.ll b/test/Feature/smallest.ll index 910af3c..5dd023c 100644 --- a/test/Feature/smallest.ll +++ b/test/Feature/smallest.ll @@ -1,7 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll - -implementation - diff --git a/test/Feature/testalloca.ll b/test/Feature/testalloca.ll index d05b70d..230b5a9 100644 --- a/test/Feature/testalloca.ll +++ b/test/Feature/testalloca.ll @@ -1,28 +1,22 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll -%inners = type {float, {ubyte } } -%struct = type { int , {float, {ubyte } } , ulong } + %inners = type { float, { i8 } } + %struct = type { i32, %inners, i64 } -implementation - -int %testfunction(int %i0, int %j0) -begin - alloca ubyte, uint 5 - %ptr = alloca int ; yields {int*}:ptr - store int 3, int* %ptr ; yields {void} - %val = load int* %ptr ; yields {int}:val = int %3 - - %sptr = alloca %struct ; yields {%struct*}:sptr - %nsptr = getelementptr %struct * %sptr, long 0, uint 1 ; yields {inners*}:nsptr - %ubsptr = getelementptr %inners * %nsptr, long 0, uint 1 ; yields {{ubyte}*}:ubsptr - %idx = getelementptr {ubyte} * %ubsptr, long 0, uint 0 - store ubyte 4, ubyte* %idx - - %fptr = getelementptr %struct * %sptr, long 0, uint 1, uint 0 ; yields {float*}:fptr - store float 4.0, float * %fptr - - ret int 3 -end +define i32 @testfunction(i32 %i0, i32 %j0) { + alloca i8, i32 5 ; <i8*>:1 [#uses=0] + %ptr = alloca i32 ; <i32*> [#uses=2] + store i32 3, i32* %ptr + %val = load i32* %ptr ; <i32> [#uses=0] + %sptr = alloca %struct ; <%struct*> [#uses=2] + %nsptr = getelementptr %struct* %sptr, i64 0, i32 1 ; <%inners*> [#uses=1] + %ubsptr = getelementptr %inners* %nsptr, i64 0, i32 1 ; <{ i8 }*> [#uses=1] + %idx = getelementptr { i8 }* %ubsptr, i64 0, i32 0 ; <i8*> [#uses=1] + store i8 4, i8* %idx + %fptr = getelementptr %struct* %sptr, i64 0, i32 1, i32 0 ; <float*> [#uses=1] + store float 4.000000e+00, float* %fptr + ret i32 3 +} diff --git a/test/Feature/testconstants.ll b/test/Feature/testconstants.ll index 7d9e119..6810f3d 100644 --- a/test/Feature/testconstants.ll +++ b/test/Feature/testconstants.ll @@ -1,33 +1,29 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll -%somestr = constant [11x sbyte] c"hello world" -%array = constant [2 x int] [ int 12, int 52 ] - constant { int, int } { int 4, int 3 } +@somestr = constant [11 x i8] c"hello world" ; <[11 x i8]*> [#uses=1] +@array = constant [2 x i32] [ i32 12, i32 52 ] ; <[2 x i32]*> [#uses=1] +constant { i32, i32 } { i32 4, i32 3 } ; <{ i32, i32 }*>:0 [#uses=0] -implementation - -[2 x int]* %testfunction(int %i0, int %j0) -begin - ret [2x int]* %array -end +define [2 x i32]* @testfunction(i32 %i0, i32 %j0) { + ret [2 x i32]* @array +} -sbyte* %otherfunc(int, double) -begin - %somestr = getelementptr [11x sbyte]* %somestr, long 0, long 0 - ret sbyte* %somestr -end +define i8* @otherfunc(i32, double) { + %somestr = getelementptr [11 x i8]* @somestr, i64 0, i64 0 ; <i8*> [#uses=1] + ret i8* %somestr +} -sbyte* %yetanotherfunc(int, double) -begin - ret sbyte* null ; Test null -end +define i8* @yetanotherfunc(i32, double) { + ret i8* null +} -uint %negativeUnsigned() { - ret uint -1 +define i32 @negativeUnsigned() { + ret i32 -1 } -int %largeSigned() { - ret int 3900000000 +define i32 @largeSigned() { + ret i32 -394967296 } + diff --git a/test/Feature/testlogical.ll b/test/Feature/testlogical.ll index 887699a..a064869 100644 --- a/test/Feature/testlogical.ll +++ b/test/Feature/testlogical.ll @@ -1,14 +1,11 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll -implementation - -int "simpleAdd"(int %i0, int %j0) -begin - %t1 = xor int %i0, %j0 - %t2 = or int %i0, %j0 - %t3 = and int %t1, %t2 - ret int %t3 -end +define i32 @simpleAdd(i32 %i0, i32 %j0) { + %t1 = xor i32 %i0, %j0 ; <i32> [#uses=1] + %t2 = or i32 %i0, %j0 ; <i32> [#uses=1] + %t3 = and i32 %t1, %t2 ; <i32> [#uses=1] + ret i32 %t3 +} diff --git a/test/Feature/testmemory.ll b/test/Feature/testmemory.ll index ce48e57..a9019f0 100644 --- a/test/Feature/testmemory.ll +++ b/test/Feature/testmemory.ll @@ -1,45 +1,36 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll -%struct = type { int , {float, {ubyte } } , ulong } -%complexty = type {int, {[4 x sbyte *], float}, double} -implementation - -int "main"() -begin - call int %testfunction(long 0, long 1) - ret int 0 -end - -int "testfunction"(long %i0, long %j0) -begin - %array0 = malloc [4 x ubyte] ; yields {[4 x ubyte]*}:array0 - %size = add uint 2, 2 ; yields {uint}:size = uint %4 - %array1 = malloc ubyte, uint 4 ; yields {ubyte*}:array1 - %array2 = malloc ubyte, uint %size ; yields {ubyte*}:array2 - - %idx = getelementptr [4 x ubyte]* %array0, long 0, long 2 - store ubyte 123, ubyte* %idx - free [4x ubyte]* %array0 - free ubyte* %array1 - free ubyte* %array2 - - - %aa = alloca %complexty, uint 5 - %idx2 = getelementptr %complexty* %aa, long %i0, uint 1, uint 0, long %j0 - store sbyte *null, sbyte** %idx2 - - %ptr = alloca int ; yields {int*}:ptr - store int 3, int* %ptr ; yields {void} - %val = load int* %ptr ; yields {int}:val = int %3 - - %sptr = alloca %struct ; yields {%struct*}:sptr - %ubsptr = getelementptr %struct * %sptr, long 0, uint 1, uint 1 ; yields {{ubyte}*}:ubsptr - %idx3 = getelementptr {ubyte} * %ubsptr, long 0, uint 0 - store ubyte 4, ubyte* %idx3 - - ret int 3 -end + %complexty = type { i32, { [4 x i8*], float }, double } + %struct = type { i32, { float, { i8 } }, i64 } + +define i32 @main() { + call i32 @testfunction( i64 0, i64 1 ) ; <i32>:1 [#uses=0] + ret i32 0 +} + +define i32 @testfunction(i64 %i0, i64 %j0) { + %array0 = malloc [4 x i8] ; <[4 x i8]*> [#uses=2] + %size = add i32 2, 2 ; <i32> [#uses=1] + %array1 = malloc i8, i32 4 ; <i8*> [#uses=1] + %array2 = malloc i8, i32 %size ; <i8*> [#uses=1] + %idx = getelementptr [4 x i8]* %array0, i64 0, i64 2 ; <i8*> [#uses=1] + store i8 123, i8* %idx + free [4 x i8]* %array0 + free i8* %array1 + free i8* %array2 + %aa = alloca %complexty, i32 5 ; <%complexty*> [#uses=1] + %idx2 = getelementptr %complexty* %aa, i64 %i0, i32 1, i32 0, i64 %j0 ; <i8**> [#uses=1] + store i8* null, i8** %idx2 + %ptr = alloca i32 ; <i32*> [#uses=2] + store i32 3, i32* %ptr + %val = load i32* %ptr ; <i32> [#uses=0] + %sptr = alloca %struct ; <%struct*> [#uses=1] + %ubsptr = getelementptr %struct* %sptr, i64 0, i32 1, i32 1 ; <{ i8 }*> [#uses=1] + %idx3 = getelementptr { i8 }* %ubsptr, i64 0, i32 0 ; <i8*> [#uses=1] + store i8 4, i8* %idx3 + ret i32 3 +} diff --git a/test/Feature/testswitch.ll b/test/Feature/testswitch.ll index 8664ace..417f56b 100644 --- a/test/Feature/testswitch.ll +++ b/test/Feature/testswitch.ll @@ -1,25 +1,26 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll - %int = type int + %int = type i32 -implementation +define i32 @squared(i32 %i0) { + switch i32 %i0, label %Default [ + i32 1, label %Case1 + i32 2, label %Case2 + i32 4, label %Case4 + ] -int "squared"(%int %i0) -begin - switch int %i0, label %Default [ - int 1, label %Case1 - int 2, label %Case2 - int 4, label %Case4 ] +Default: ; preds = %0 + ret i32 -1 -Default: - ret int -1 ; Unrecognized input value +Case1: ; preds = %0 + ret i32 1 + +Case2: ; preds = %0 + ret i32 4 + +Case4: ; preds = %0 + ret i32 16 +} -Case1: - ret int 1 -Case2: - ret int 4 -Case4: - ret int 16 -end diff --git a/test/Feature/testvarargs.ll b/test/Feature/testvarargs.ll index 196ab01..a73b7ec 100644 --- a/test/Feature/testvarargs.ll +++ b/test/Feature/testvarargs.ll @@ -1,15 +1,12 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll -implementation -declare int "printf"(sbyte*, ...) ;; Prototype for: int __builtin_printf(const char*, ...) - -int "testvarar"() -begin - call int(sbyte*, ...) *%printf(sbyte * null, int 12, sbyte 42); - ret int %0 -end +declare i32 @printf(i8*, ...) ;; Prototype for: int __builtin_printf(const char*, ...) +define i32 @testvarar() { + call i32 (i8*, ...)* @printf( i8* null, i32 12, i8 42 ) ; <i32>:1 [#uses=1] + ret i32 %1 +} diff --git a/test/Feature/undefined.ll b/test/Feature/undefined.ll index dc1b7c5..e63ce41 100644 --- a/test/Feature/undefined.ll +++ b/test/Feature/undefined.ll @@ -1,19 +1,17 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll +@X = global i32 undef ; <i32*> [#uses=0] -%X = global int undef +declare i32 @atoi(i8*) -implementation - -declare int "atoi"(sbyte *) - -int %test() { - ret int undef +define i32 @test() { + ret i32 undef } -int %test2() { - %X = add int undef, 1 - ret int %X +define i32 @test2() { + %X = add i32 undef, 1 ; <i32> [#uses=1] + ret i32 %X } + diff --git a/test/Feature/unreachable.ll b/test/Feature/unreachable.ll index 48558dd..8bffb4c 100644 --- a/test/Feature/unreachable.ll +++ b/test/Feature/unreachable.ll @@ -1,17 +1,15 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll +declare void @bar() -implementation - -declare void %bar() - -int %foo() { ;; Calling this function has undefined behavior - unreachable +define i32 @foo() { + unreachable } -double %xyz() { - call void %bar() - unreachable ;; Bar must not return. +define double @xyz() { + call void @bar( ) + unreachable } + diff --git a/test/Feature/varargs.ll b/test/Feature/varargs.ll index 672d96a..b9317df 100644 --- a/test/Feature/varargs.ll +++ b/test/Feature/varargs.ll @@ -1,24 +1,29 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll ; Demonstrate all of the variable argument handling intrinsic functions plus ; the va_arg instruction. -implementation -declare void %llvm.va_start(sbyte** %ap) -declare void %llvm.va_copy(sbyte** %aq, sbyte** %ap) -declare void %llvm.va_end(sbyte** %ap) +declare void @llvm.va_start(i8*) -int %test(int %X, ...) { - %ap = alloca sbyte* - call void %llvm.va_start(sbyte** %ap) - %tmp = va_arg sbyte** %ap, int +declare void @llvm.va_copy(i8*, i8*) - %aq = alloca sbyte* - call void %llvm.va_copy(sbyte** %aq, sbyte** %ap) - call void %llvm.va_end(sbyte** %aq) - - call void %llvm.va_end(sbyte** %ap) - ret int %tmp +declare void @llvm.va_end(i8*) + +define i32 @test(i32 %X, ...) { + %ap = alloca i8* ; <i8**> [#uses=4] + %va.upgrd.1 = bitcast i8** %ap to i8* ; <i8*> [#uses=1] + call void @llvm.va_start( i8* %va.upgrd.1 ) + %tmp = va_arg i8** %ap, i32 ; <i32> [#uses=1] + %aq = alloca i8* ; <i8**> [#uses=2] + %va0.upgrd.2 = bitcast i8** %aq to i8* ; <i8*> [#uses=1] + %va1.upgrd.3 = bitcast i8** %ap to i8* ; <i8*> [#uses=1] + call void @llvm.va_copy( i8* %va0.upgrd.2, i8* %va1.upgrd.3 ) + %va.upgrd.4 = bitcast i8** %aq to i8* ; <i8*> [#uses=1] + call void @llvm.va_end( i8* %va.upgrd.4 ) + %va.upgrd.5 = bitcast i8** %ap to i8* ; <i8*> [#uses=1] + call void @llvm.va_end( i8* %va.upgrd.5 ) + ret i32 %tmp } + diff --git a/test/Feature/varargs_new.ll b/test/Feature/varargs_new.ll index a0e8c46..a46f270 100644 --- a/test/Feature/varargs_new.ll +++ b/test/Feature/varargs_new.ll @@ -1,33 +1,38 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll ; Demonstrate all of the variable argument handling intrinsic functions plus ; the va_arg instruction. -implementation ; Functions: -declare void %llvm.va_start(sbyte**) -declare void %llvm.va_copy(sbyte**, sbyte*) -declare void %llvm.va_end(sbyte**) +declare void @llvm.va_start(i8*) -int %test(int %X, ...) { +declare void @llvm.va_copy(i8*, i8*) + +declare void @llvm.va_end(i8*) + +define i32 @test(i32 %X, ...) { ; Allocate two va_list items. On this target, va_list is of type sbyte* - %ap = alloca sbyte* ; <sbyte**> [#uses=4] - %aq = alloca sbyte* ; <sbyte**> [#uses=2] + %ap = alloca i8* ; <i8**> [#uses=4] + %aq = alloca i8* ; <i8**> [#uses=2] ; Initialize variable argument processing - call void %llvm.va_start(sbyte** %ap) + %va.upgrd.1 = bitcast i8** %ap to i8* ; <i8*> [#uses=1] + call void @llvm.va_start( i8* %va.upgrd.1 ) ; Read a single integer argument - %tmp = va_arg sbyte** %ap, int ; <int> [#uses=1] + %tmp = va_arg i8** %ap, i32 ; <i32> [#uses=1] ; Demonstrate usage of llvm.va_copy and llvm_va_end - %apv = load sbyte** %ap ; <sbyte*> [#uses=1] - call void %llvm.va_copy(sbyte** %aq, sbyte* %apv) - call void %llvm.va_end(sbyte** %aq) + %apv = load i8** %ap ; <i8*> [#uses=1] + %va0.upgrd.2 = bitcast i8** %aq to i8* ; <i8*> [#uses=1] + %va1.upgrd.3 = bitcast i8* %apv to i8* ; <i8*> [#uses=1] + call void @llvm.va_copy( i8* %va0.upgrd.2, i8* %va1.upgrd.3 ) + %va.upgrd.4 = bitcast i8** %aq to i8* ; <i8*> [#uses=1] + call void @llvm.va_end( i8* %va.upgrd.4 ) ; Stop processing of arguments. - call void %llvm.va_end(sbyte** %ap) - ret int %tmp - + %va.upgrd.5 = bitcast i8** %ap to i8* ; <i8*> [#uses=1] + call void @llvm.va_end( i8* %va.upgrd.5 ) + ret i32 %tmp } diff --git a/test/Feature/weirdnames.ll b/test/Feature/weirdnames.ll index e579758..cc773cd 100644 --- a/test/Feature/weirdnames.ll +++ b/test/Feature/weirdnames.ll @@ -1,10 +1,9 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll ; Test using double quotes to form names that are not legal in the % form - -"&^ " = type { int } -"%.*+ foo" = global "&^ " { int 5 } -"0" = global float 0.0 ; This CANNOT be %0 -"\03foo" = global float 0x3FB99999A0000000 ; Make sure funny char gets round trip +%"&^ " = type { i32 } +@"%.*+ foo" = global %"&^ " { i32 5 } +@"0" = global float 0.000000e+00 ; This CANNOT be %0 +@"\\03foo" = global float 0x3FB99999A0000000 ; Make sure funny char gets round trip |