aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorgingerBill <ginger.bill.22@gmail.com>2016-08-03 22:27:24 +0100
committergingerBill <ginger.bill.22@gmail.com>2016-08-03 22:27:36 +0100
commit19aea1f19895b035e8abb424987f48df6bc52c53 (patch)
tree879cb256f2985d2a6774b96cedad8b6752deb72c /examples
parent0e92166d442b120b06db57623a93c6ec43e3fccb (diff)
Basic call expression and fix to assignment count checking
Diffstat (limited to 'examples')
-rw-r--r--examples/test.ll23
-rw-r--r--examples/test.odin6
2 files changed, 4 insertions, 25 deletions
diff --git a/examples/test.ll b/examples/test.ll
index 295c13666..e69de29bb 100644
--- a/examples/test.ll
+++ b/examples/test.ll
@@ -1,23 +0,0 @@
-define void @main() {
-"entry - 0":
- %0 = alloca [16 x i64], align 8 ; a
- store [16 x i64] zeroinitializer, [16 x i64]* %0
- %1 = alloca {i64*, i64, i64}, align 8 ; b
- store {i64*, i64, i64} zeroinitializer, {i64*, i64, i64}* %1
- %2 = sub i64 1, 0
- %3 = sub i64 2, 0
- %4 = getelementptr inbounds [16 x i64], [16 x i64]* %0, i64 0, i64 0
- %5 = getelementptr i64, i64* %4, i64 0
- %6 = alloca {i64*, i64, i64}, align 8
- store {i64*, i64, i64} zeroinitializer, {i64*, i64, i64}* %6
- %7 = getelementptr inbounds {i64*, i64, i64}, {i64*, i64, i64}* %6, i64 0, i32 0
- store i64* %5, i64** %7
- %8 = getelementptr inbounds {i64*, i64, i64}, {i64*, i64, i64}* %6, i64 0, i32 1
- store i64 %2, i64* %8
- %9 = getelementptr inbounds {i64*, i64, i64}, {i64*, i64, i64}* %6, i64 0, i32 2
- store i64 %3, i64* %9
- %10 = load {i64*, i64, i64}, {i64*, i64, i64}* %6
- store {i64*, i64, i64} %10, {i64*, i64, i64}* %1
- ret void
-}
-
diff --git a/examples/test.odin b/examples/test.odin
index a2054dcff..47090bfc0 100644
--- a/examples/test.odin
+++ b/examples/test.odin
@@ -1,5 +1,7 @@
+add :: proc(x, y : int) -> (int, int) {
+ return x+y, 1;
+}
+
main :: proc() {
- a : [16]int;
- b := a[0:1:2];
}