From 82d6dfd3e9a7240fe0f045b6955cda00e1f6cd31 Mon Sep 17 00:00:00 2001 From: Niki4tap Date: Wed, 6 Oct 2021 12:52:59 +0000 Subject: [PATCH] pkg(llvm_ir-12.0.1): Added llvm_ir 12.0.1 --- packages/llvm_ir/12.0.1/build.sh | 6 ++++++ packages/llvm_ir/12.0.1/compile | 4 ++++ packages/llvm_ir/12.0.1/environment | 2 ++ packages/llvm_ir/12.0.1/metadata.json | 5 +++++ packages/llvm_ir/12.0.1/run | 4 ++++ packages/llvm_ir/12.0.1/test.ll | 10 ++++++++++ 6 files changed, 31 insertions(+) create mode 100755 packages/llvm_ir/12.0.1/build.sh create mode 100755 packages/llvm_ir/12.0.1/compile create mode 100644 packages/llvm_ir/12.0.1/environment create mode 100644 packages/llvm_ir/12.0.1/metadata.json create mode 100644 packages/llvm_ir/12.0.1/run create mode 100644 packages/llvm_ir/12.0.1/test.ll diff --git a/packages/llvm_ir/12.0.1/build.sh b/packages/llvm_ir/12.0.1/build.sh new file mode 100755 index 0000000..7afd41a --- /dev/null +++ b/packages/llvm_ir/12.0.1/build.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +curl -L "https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.1/clang+llvm-12.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz" -o llvm-ir.tar.xz + +tar xf llvm-ir.tar.xz clang+llvm-12.0.1-x86_64-linux-gnu-ubuntu-/bin --strip-components=1 + +rm llvm-ir.tar.xz diff --git a/packages/llvm_ir/12.0.1/compile b/packages/llvm_ir/12.0.1/compile new file mode 100755 index 0000000..082fb5c --- /dev/null +++ b/packages/llvm_ir/12.0.1/compile @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +llc "$@" -o binary.s +clang binary.s -o binary diff --git a/packages/llvm_ir/12.0.1/environment b/packages/llvm_ir/12.0.1/environment new file mode 100644 index 0000000..85a25b6 --- /dev/null +++ b/packages/llvm_ir/12.0.1/environment @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +export PATH=$PWD/bin:$PATH diff --git a/packages/llvm_ir/12.0.1/metadata.json b/packages/llvm_ir/12.0.1/metadata.json new file mode 100644 index 0000000..8ef2dc3 --- /dev/null +++ b/packages/llvm_ir/12.0.1/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "llvm_ir", + "version": "12.0.1", + "aliases": ["llvm", "llvm-ir"] +} diff --git a/packages/llvm_ir/12.0.1/run b/packages/llvm_ir/12.0.1/run new file mode 100644 index 0000000..94b3b0b --- /dev/null +++ b/packages/llvm_ir/12.0.1/run @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +shift +binary "$@" diff --git a/packages/llvm_ir/12.0.1/test.ll b/packages/llvm_ir/12.0.1/test.ll new file mode 100644 index 0000000..35786b2 --- /dev/null +++ b/packages/llvm_ir/12.0.1/test.ll @@ -0,0 +1,10 @@ +@.str = private unnamed_addr constant [3 x i8] c"OK\n" + +declare i32 @puts(i8* nocapture) nounwind + +define i32 @main() { + %cast210 = getelementptr [3 x i8],[3 x i8]* @.str, i64 0, i64 0 + + call i32 @puts(i8* %cast210) + ret i32 0 +}