This repository has been archived on 2023-11-05. You can view files and clone it, but cannot push or open issues or pull requests.
wasm-micro-runtime/samples/native-lib/wasm-app/main.c
Wenyong Huang 2007ba38cf
Enable register native with iwasm (#1120)
Enable register native with iwasm application, add sample and update document.
2022-04-27 11:12:50 +08:00

30 lines
482 B
C

/*
* Copyright (C) 2019 Intel Corporation. All rights reserved.
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
*/
#include <stdio.h>
#include <stdlib.h>
int
test_add(int x, int y);
int
test_sqrt(int x, int y);
int
main(int argc, char **argv)
{
int x = 10, y = 20, res;
printf("Hello World!\n");
res = test_add(x, y);
printf("%d + %d = %d\n", x, y, res);
res = test_sqrt(x, y);
printf("sqrt(%d, %d) = %d\n", x, y, res);
return 0;
}