aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorgingerBill <ginger.bill.22@gmail.com>2016-08-03 14:17:13 +0100
committergingerBill <ginger.bill.22@gmail.com>2016-08-03 14:17:13 +0100
commit0e92166d442b120b06db57623a93c6ec43e3fccb (patch)
tree3912ff47c21eb848cfd754b745c262f7a4f4b04d /examples
parent41e7cadb8df4b9833bc3dd827cac32fd3b01ddbd (diff)
Slice creation for SliceExpr
Diffstat (limited to 'examples')
-rw-r--r--examples/test.ll23
-rw-r--r--examples/test.odin3
2 files changed, 23 insertions, 3 deletions
diff --git a/examples/test.ll b/examples/test.ll
index a66808824..295c13666 100644
--- a/examples/test.ll
+++ b/examples/test.ll
@@ -1,6 +1,23 @@
-; ModuleID = '..\examples/test.bc'
-
define void @main() {
"entry - 0":
- ret void
+ %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 fd7194210..a2054dcff 100644
--- a/examples/test.odin
+++ b/examples/test.odin
@@ -1,2 +1,5 @@
main :: proc() {
+ a : [16]int;
+ b := a[0:1:2];
+
}