diff --git a/backend/src/langs.ts b/backend/src/langs.ts index ab421ea..678741a 100644 --- a/backend/src/langs.ts +++ b/backend/src/langs.ts @@ -147,7 +147,7 @@ implement main0 () = () `, }, c: { - aliases: ["gcc", "llvm", "clang", "h", "cc", "c99", "c11", "c18"], + aliases: ["gcc", "clang", "h", "cc", "c99", "c11", "c18"], name: "C", monacoLang: "c", main: "main.c", @@ -601,6 +601,34 @@ PLEASE GIVE UP createEmpty: true, run: `SHELL=/usr/bin/ksh HOME="$PWD" ksh`, template: `echo "Hello, world!" +`, + }, + llvm: { + name: "LLVM", + monacoLang: "shell", + main: "main.ll", + compile: "clang -Wno-override-module main.ll -o main", + run: "./main", + template: `; Copied directly from the documentation +; Declare the string constant as a global constant. +@.str = private unnamed_addr constant [13 x i8] c"hello world\\0A\\00" + +; External declaration of the puts function +declare i32 @puts(i8* nocapture) nounwind + +; Definition of main function +define i32 @main() { ; i32()* + ; Convert [13 x i8]* to i8 *... + %cast210 = getelementptr [13 x i8],[13 x i8]* @.str, i64 0, i64 0 + + ; Call puts function to write out the string to stdout. + call i32 @puts(i8* %cast210) + ret i32 0 +} + +; Named metadata +!0 = !{i32 42, null, !"string"} +!foo = !{!0} `, }, lolcode: { diff --git a/scripts/docker-install-phase3b.bash b/scripts/docker-install-phase3b.bash index 0a6e4fa..b0cd0df 100755 --- a/scripts/docker-install-phase3b.bash +++ b/scripts/docker-install-phase3b.bash @@ -53,6 +53,9 @@ julia # Ksh ksh +# LLVM +llvm + # LOLCODE cmake