diff options
40 files changed, 624 insertions, 705 deletions
diff --git a/test/Feature/alignment.ll b/test/Feature/alignment.ll index 9277dbc8bd..409efebe84 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 cf040ec250..2303b593ff 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 5617f9f26f..d2e9de404f 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 f015223c5d..feafd3cd20 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 96f971a0e8..d9c22ffd18 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 b16af47af1..e667f6d758 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 aea8944848..13e6f365aa 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 d1dddaadb3..5c1bed194b 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 4532fe99bc..7f5f6197eb 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 c1532eb0b3..632cfb741f 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 66e972bad8..cdf8da69f6 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 edb1f281eb..26d214ae88 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 08a2c323dd..b8f5eb1b66 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 642c093d16..42e2d1aeee 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 9949e05282..0000000000 --- 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 26259dad4c..9a23775269 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" |