-
Notifications
You must be signed in to change notification settings - Fork 11
/
index.html
35 lines (32 loc) · 1.14 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script>
window.onload = () => {
import('./index.js').then(({ compileAndRun }) => {
document.getElementById('compile-and-run').onclick = () => {
compileAndRun(document.getElementById('input').value)
.then((output) => document.getElementById('output').value = output)
}
})
}
</script>
</head>
<body>
<textarea id="input" cols="80" rows="24" spellcheck="false">@.str = private constant [13 x i8] c"Hello wasm!\0A\00"
@__main_void = hidden alias i32 (), ptr @main
declare i32 @printf(i8*, ...)
define i32 @main() {
entry:
%call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i32 0, i32 0))
ret i32 0
}
</textarea>
<br/>
<input id="compile-and-run" value="Compile and run" type="button">
<br/>
<textarea id="output" cols="80" rows="24" spellcheck="false"></textarea>
</body>
</html>