From bbcec684e38252647d987ea00b217468e943f277 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Thu, 10 Jul 2008 22:35:32 +0000 Subject: Put CPPBackend tests into their own directory and run them only if they're supported. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53427 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/CPP/2007-06-16-Funcname.ll | 7 + test/CodeGen/CPP/dg.exp | 5 + test/CodeGen/CPP/llvm2cpp.ll | 756 ++++++++++++++++++++++++++++++++ 3 files changed, 768 insertions(+) create mode 100644 test/CodeGen/CPP/2007-06-16-Funcname.ll create mode 100644 test/CodeGen/CPP/dg.exp create mode 100644 test/CodeGen/CPP/llvm2cpp.ll (limited to 'test/CodeGen/CPP') diff --git a/test/CodeGen/CPP/2007-06-16-Funcname.ll b/test/CodeGen/CPP/2007-06-16-Funcname.ll new file mode 100644 index 0000000..75b96e6 --- /dev/null +++ b/test/CodeGen/CPP/2007-06-16-Funcname.ll @@ -0,0 +1,7 @@ +; RUN: llvm-as < %s | llc -march=cpp -cppfname=WAKKA | not grep makeLLVMModule +; PR1515 + +define void @foo() { + ret void +} + diff --git a/test/CodeGen/CPP/dg.exp b/test/CodeGen/CPP/dg.exp new file mode 100644 index 0000000..3276dcc --- /dev/null +++ b/test/CodeGen/CPP/dg.exp @@ -0,0 +1,5 @@ +load_lib llvm.exp + +if { [llvm_supports_target CppBackend] } { + RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]] +} diff --git a/test/CodeGen/CPP/llvm2cpp.ll b/test/CodeGen/CPP/llvm2cpp.ll new file mode 100644 index 0000000..651a65b --- /dev/null +++ b/test/CodeGen/CPP/llvm2cpp.ll @@ -0,0 +1,756 @@ +; RUN: llvm-as < %s | llvm-dis > /dev/null +; RUN: llvm-as < %s | llc -march=cpp -cppgen=program -o - + +@X = global i32 4, align 16 ; [#uses=0] + +define i32* @test1012() 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* @test1013() { + %X = malloc i32, align 4 ; [#uses=1] + %Y = malloc i32, i32 42, align 16 ; [#uses=0] + %Z = malloc i32 ; [#uses=0] + ret i32* %X +} + +define void @void(i32, i32) { + add i32 0, 0 ; :3 [#uses=2] + sub i32 0, 4 ; :4 [#uses=2] + br label %5 + +;