aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorgingerBill <ginger.bill.22@gmail.com>2016-08-02 20:53:18 +0100
committergingerBill <ginger.bill.22@gmail.com>2016-08-02 20:53:18 +0100
commit41e7cadb8df4b9833bc3dd827cac32fd3b01ddbd (patch)
tree81272c3361a9f19e97caa8a760553b3e700b31bc /examples
parentbf3283c889ce387fd252b48e12e090fab7446048 (diff)
ret, unreachable, param, deref
Diffstat (limited to 'examples')
-rw-r--r--examples/test.c13
-rw-r--r--examples/test.ll19
-rw-r--r--examples/test.odin6
3 files changed, 9 insertions, 29 deletions
diff --git a/examples/test.c b/examples/test.c
index bf1d9fafe..49a4a64da 100644
--- a/examples/test.c
+++ b/examples/test.c
@@ -1,11 +1,8 @@
+void test(void) {
+}
+
int main() {
- int x = 15;
- int y = 4;
- x = x & (~y);
- if (x > 0) {
- x = 123;
- } else {
- x = 321;
- }
+ void (*f)(void) = test;
+
return 0;
}
diff --git a/examples/test.ll b/examples/test.ll
index c8d5f46ee..a66808824 100644
--- a/examples/test.ll
+++ b/examples/test.ll
@@ -1,17 +1,6 @@
+; ModuleID = '..\examples/test.bc'
+
define void @main() {
-entry:
- %0 = alloca i64, align 8 ; x
- store i64 zeroinitializer, i64* %0
- store i64 15, i64* %0
- %1 = load i64, i64* %0
- %2 = icmp sgt i64 %1, 0
- br i1 %2, label %if-then, label %if-else
-if-then:
- store i64 123, i64* %0
- br label %if-end
-if-else:
- store i64 321, i64* %0
- br label %if-end
-if-end:
- ret void
+"entry - 0":
+ ret void
}
diff --git a/examples/test.odin b/examples/test.odin
index 1f1de7750..fd7194210 100644
--- a/examples/test.odin
+++ b/examples/test.odin
@@ -1,8 +1,2 @@
main :: proc() {
- x : int = 15;
- if x > 0 {
- x = 123;
- } else {
- x = 321;
- }
}