New language: LLVM
This commit is contained in:
parent
7aadfaa421
commit
5d85e2036d
|
@ -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: {
|
||||
|
|
|
@ -53,6 +53,9 @@ julia
|
|||
# Ksh
|
||||
ksh
|
||||
|
||||
# LLVM
|
||||
llvm
|
||||
|
||||
# LOLCODE
|
||||
cmake
|
||||
|
||||
|
|
Loading…
Reference in New Issue