summaryrefslogtreecommitdiffstats
path: root/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/samples/multi-module/wasm-apps/mC.c
blob: 8b19a5b6690c550663954d7fa0fe785d580eda83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <stdio.h>
#include <stdlib.h>

__attribute__((import_module("mA")))
__attribute__((import_name("A1"))) extern int
A1();

__attribute__((import_module("mB")))
__attribute__((import_name("B1"))) extern int
B1();

__attribute__((import_module("mB")))
__attribute__((import_name("B2"))) extern int
B2();

__attribute__((export_name("C1"))) int
C1()
{
    return 31;
}

__attribute__((export_name("C2"))) int
C2()
{
    return B1();
}

__attribute__((export_name("C3"))) int
C3()
{
    return A1();
}

__attribute__((export_name("C4"))) int
C4()
{
    return B2();
}

int
C5()
{
    return C1() + C2() + C3() + 35;
}

int
main()
{
    printf("%u\n", C5());
    return EXIT_SUCCESS;
}