diff options
| author | gingerBill <bill@gingerbill.org> | 2018-12-08 11:45:08 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2018-12-08 11:45:08 +0000 |
| commit | 13f084a219320a39eaa06dc4527f720231cc9710 (patch) | |
| tree | 936a3aae0eafa8c8ef8f57cf5083b1c24bb401b5 | |
| parent | 4205f0f0b1d0141d1853d14ff66501935a7bcc6f (diff) | |
Fix `foreign export` #294
| -rw-r--r-- | examples/demo/demo.odin | 8 | ||||
| -rw-r--r-- | src/ir.cpp | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/examples/demo/demo.odin b/examples/demo/demo.odin index 9fc6db2a8..5f4f0dfb2 100644 --- a/examples/demo/demo.odin +++ b/examples/demo/demo.odin @@ -836,8 +836,14 @@ diverging_procedures :: proc() { foo(); } +foreign export { + bar :: proc "c" () -> i32 { + return 123; + } +} + main :: proc() { - when true { + when false { general_stuff(); union_type(); parametric_polymorphism(); diff --git a/src/ir.cpp b/src/ir.cpp index ea7719af2..77587516d 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -9744,6 +9744,7 @@ void ir_gen_tree(irGen *s) { irValue *p = ir_value_procedure(m, e, e->type, type_expr, body, name); p->Proc.tags = pl->tags; p->Proc.inlining = pl->inlining; + p->Proc.is_export = e->Procedure.is_export; ir_module_add_value(m, e, p); HashKey hash_name = hash_string(name); |