mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-13 01:21:38 -07:00
ret, unreachable, param, deref
This commit is contained in:
+5
-8
@@ -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;
|
||||
}
|
||||
|
||||
+4
-15
@@ -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
|
||||
}
|
||||
|
||||
@@ -1,8 +1,2 @@
|
||||
main :: proc() {
|
||||
x : int = 15;
|
||||
if x > 0 {
|
||||
x = 123;
|
||||
} else {
|
||||
x = 321;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user