| 1 | // This file tests the ability to export functions to C with a fully custom name. |
| 2 | |
| 3 | // It also tests, that the exported functions will be exported as weak symbols, |
| 4 | // if the user tagged them as such. |
| 5 | |
| 6 | @[export: abcd] |
| 7 | fn my_fn() int { |
| 8 | return 42 |
| 9 | } |
| 10 | |
| 11 | @[export: wxyz] |
| 12 | @[weak] |
| 13 | fn my_other_fn() int { |
| 14 | return 11 |
| 15 | } |
| 16 | |
| 17 | fn main() { |
| 18 | println(my_fn()) |
| 19 | println(my_other_fn()) |
| 20 | } |
| 21 |