diff --git a/example_test.go b/example_test.go new file mode 100644 index 0000000..68c30a9 --- /dev/null +++ b/example_test.go @@ -0,0 +1,154 @@ +package irutil_test + +import ( + "fmt" + "log" + + "github.com/llir/irutil" + "github.com/llir/llvm/asm" + "github.com/llir/llvm/ir" + "github.com/llir/llvm/ir/value" + "github.com/pkg/errors" +) + +func Example() { + // Parse LLVM IR module. + const module = ` +define void @g() { + ; potential side effects + ret void +} + +define i32 @f(i32 %x, i32 %y) { +;