import org.graalvm.polyglot.*;
import java.io.*;
public class HelloPolyglot {
public static void main(String[] args) {
try {
Context ctx = Context.newBuilder().allowAllAccess(true).build();
File file = new File("test.bc");
Source source = Source.newBuilder("llvm", file).build();
Value c = ctx.eval(source);
c.getMember("main").execute();
Value add = c.getMember("add");
Value ret = add.execute(10, 20);
System.out.println(ret.asInt());
} catch (IOException e) {
System.err.println(e);
}
}
}