From 3277b69d734b9c90b44ebde4ede005717e2c3b2e Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 2 Jun 2009 17:52:33 +0000 Subject: Import LLVM, at r72732. --- test/Feature/README.txt | 6 +++ test/Feature/aliases.ll | 32 +++++++++++ test/Feature/alignment.ll | 21 ++++++++ test/Feature/basictest.ll | 31 +++++++++++ test/Feature/callingconventions.ll | 50 +++++++++++++++++ test/Feature/calltest.ll | 32 +++++++++++ test/Feature/casttest.ll | 12 +++++ test/Feature/cfgstructures.ll | 53 +++++++++++++++++++ test/Feature/constexpr.ll | 80 ++++++++++++++++++++++++++++ test/Feature/constpointer.ll | 31 +++++++++++ test/Feature/dg.exp | 3 ++ test/Feature/embeddedmetadata.ll | 11 ++++ test/Feature/escaped_label.ll | 11 ++++ test/Feature/float.ll | 6 +++ test/Feature/fold-fpcast.ll | 18 +++++++ test/Feature/forwardreftest.ll | 29 ++++++++++ test/Feature/global_section.ll | 10 ++++ test/Feature/globalredefinition.ll | 18 +++++++ test/Feature/globalredefinition3.ll | 4 ++ test/Feature/globalvars.ll | 18 +++++++ test/Feature/indirectcall.ll | 49 +++++++++++++++++ test/Feature/indirectcall2.ll | 22 ++++++++ test/Feature/inlineasm.ll | 13 +++++ test/Feature/instructions.ll | 24 +++++++++ test/Feature/intrinsics.ll | 62 ++++++++++++++++++++++ test/Feature/llvm2cpp.exp | 3 ++ test/Feature/load_module.ll | 10 ++++ test/Feature/newcasts.ll | 33 ++++++++++++ test/Feature/noalias-ret.ll | 6 +++ test/Feature/opaquetypes.ll | 55 +++++++++++++++++++ test/Feature/packed.ll | 15 ++++++ test/Feature/packed_struct.ll | 33 ++++++++++++ test/Feature/paramattrs.ll | 22 ++++++++ test/Feature/ppcld.ll | 26 +++++++++ test/Feature/properties.ll | 7 +++ test/Feature/prototype.ll | 11 ++++ test/Feature/recursivetype.ll | 103 ++++++++++++++++++++++++++++++++++++ test/Feature/simplecalltest.ll | 24 +++++++++ test/Feature/small.ll | 11 ++++ test/Feature/smallest.ll | 4 ++ test/Feature/sparcld.ll | 24 +++++++++ test/Feature/testalloca.ll | 22 ++++++++ test/Feature/testconstants.ll | 29 ++++++++++ test/Feature/testlogical.ll | 11 ++++ test/Feature/testmemory.ll | 36 +++++++++++++ test/Feature/testswitch.ll | 26 +++++++++ test/Feature/testtype.ll | 21 ++++++++ test/Feature/testvarargs.ll | 12 +++++ test/Feature/undefined.ll | 17 ++++++ test/Feature/unreachable.ll | 15 ++++++ test/Feature/varargs.ll | 29 ++++++++++ test/Feature/varargs_new.ll | 38 +++++++++++++ test/Feature/weak_constant.ll | 38 +++++++++++++ test/Feature/weirdnames.ll | 9 ++++ test/Feature/x86ld.ll | 26 +++++++++ 55 files changed, 1362 insertions(+) create mode 100644 test/Feature/README.txt create mode 100644 test/Feature/aliases.ll create mode 100644 test/Feature/alignment.ll create mode 100644 test/Feature/basictest.ll create mode 100644 test/Feature/callingconventions.ll create mode 100644 test/Feature/calltest.ll create mode 100644 test/Feature/casttest.ll create mode 100644 test/Feature/cfgstructures.ll create mode 100644 test/Feature/constexpr.ll create mode 100644 test/Feature/constpointer.ll create mode 100644 test/Feature/dg.exp create mode 100644 test/Feature/embeddedmetadata.ll create mode 100644 test/Feature/escaped_label.ll create mode 100644 test/Feature/float.ll create mode 100644 test/Feature/fold-fpcast.ll create mode 100644 test/Feature/forwardreftest.ll create mode 100644 test/Feature/global_section.ll create mode 100644 test/Feature/globalredefinition.ll create mode 100644 test/Feature/globalredefinition3.ll create mode 100644 test/Feature/globalvars.ll create mode 100644 test/Feature/indirectcall.ll create mode 100644 test/Feature/indirectcall2.ll create mode 100644 test/Feature/inlineasm.ll create mode 100644 test/Feature/instructions.ll create mode 100644 test/Feature/intrinsics.ll create mode 100644 test/Feature/llvm2cpp.exp create mode 100644 test/Feature/load_module.ll create mode 100644 test/Feature/newcasts.ll create mode 100644 test/Feature/noalias-ret.ll create mode 100644 test/Feature/opaquetypes.ll create mode 100644 test/Feature/packed.ll create mode 100644 test/Feature/packed_struct.ll create mode 100644 test/Feature/paramattrs.ll create mode 100644 test/Feature/ppcld.ll create mode 100644 test/Feature/properties.ll create mode 100644 test/Feature/prototype.ll create mode 100644 test/Feature/recursivetype.ll create mode 100644 test/Feature/simplecalltest.ll create mode 100644 test/Feature/small.ll create mode 100644 test/Feature/smallest.ll create mode 100644 test/Feature/sparcld.ll create mode 100644 test/Feature/testalloca.ll create mode 100644 test/Feature/testconstants.ll create mode 100644 test/Feature/testlogical.ll create mode 100644 test/Feature/testmemory.ll create mode 100644 test/Feature/testswitch.ll create mode 100644 test/Feature/testtype.ll create mode 100644 test/Feature/testvarargs.ll create mode 100644 test/Feature/undefined.ll create mode 100644 test/Feature/unreachable.ll create mode 100644 test/Feature/varargs.ll create mode 100644 test/Feature/varargs_new.ll create mode 100644 test/Feature/weak_constant.ll create mode 100644 test/Feature/weirdnames.ll create mode 100644 test/Feature/x86ld.ll (limited to 'test/Feature') diff --git a/test/Feature/README.txt b/test/Feature/README.txt new file mode 100644 index 0000000..5947bb2 --- /dev/null +++ b/test/Feature/README.txt @@ -0,0 +1,6 @@ +This directory contains test cases for individual source features of LLVM. +It is designed to make sure that the major components of LLVM support all of the +features of LLVM, for very small examples. Entire programs should not go here. + +Regression tests for individual bug fixes should go into the test/Regression dir. + diff --git a/test/Feature/aliases.ll b/test/Feature/aliases.ll new file mode 100644 index 0000000..d44dff4 --- /dev/null +++ b/test/Feature/aliases.ll @@ -0,0 +1,32 @@ +; RUN: llvm-as < %s | llvm-dis > %t1.ll +; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll +; RUN: diff %t1.ll %t2.ll + +@bar = external global i32 +@foo1 = alias i32* @bar +@foo2 = alias i32* @bar +@foo3 = alias i32* @foo2 + +%FunTy = type i32() + +declare i32 @foo_f() +@bar_f = alias weak %FunTy* @foo_f +@bar_ff = alias i32()* @bar_f + +@bar_i = alias internal i32* @bar + +@A = alias bitcast (i32* @bar to i64*) + +define i32 @test() { +entry: + %tmp = load i32* @foo1 + %tmp1 = load i32* @foo2 + %tmp0 = load i32* @bar_i + %tmp2 = call i32 @foo_f() + %tmp3 = add i32 %tmp, %tmp2 + %tmp4 = call %FunTy* @bar_f() + %tmp5 = add i32 %tmp3, %tmp4 + %tmp6 = add i32 %tmp1, %tmp5 + %tmp7 = add i32 %tmp6, %tmp0 + ret i32 %tmp7 +} diff --git a/test/Feature/alignment.ll b/test/Feature/alignment.ll new file mode 100644 index 0000000..409efeb --- /dev/null +++ b/test/Feature/alignment.ll @@ -0,0 +1,21 @@ +; 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 4, align 16 ; [#uses=0] + +define i32* @test() align 32 { + %X = alloca i32, align 4 ; [#uses=1] + %Y = alloca i32, i32 42, align 16 ; [#uses=0] + %Z = alloca i32 ; [#uses=0] + ret i32* %X +} + +define i32* @test2() { + %X = malloc i32, align 4 ; [#uses=1] + %Y = malloc i32, i32 42, align 16 ; [#uses=0] + %Z = malloc i32 ; [#uses=0] + %T = malloc i32, align 256 ; [#uses=0] + ret i32* %X +} + diff --git a/test/Feature/basictest.ll b/test/Feature/basictest.ll new file mode 100644 index 0000000..2303b59 --- /dev/null +++ b/test/Feature/basictest.ll @@ -0,0 +1,31 @@ +; 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 "stripped" format where nothing is symbolic... this is how the bytecode +; format looks anyways (except for negative vs positive offsets)... +; + +define void @void(i32, i32) { + add i32 0, 0 ; :3 [#uses=2] + sub i32 0, 4 ; :4 [#uses=2] + br label %5 + +;