gllvm/tests/entry_test.go

31 lines
569 B
Go
Raw Normal View History

2019-10-20 22:42:26 +02:00
package test
import (
2019-10-22 19:53:26 +02:00
"fmt"
2019-10-20 22:42:26 +02:00
"github.com/SRI-CSL/gllvm/shared"
"testing"
)
func Test_basic_functionality(t *testing.T) {
2019-10-22 19:53:26 +02:00
args := []string{"../data/helloworld.c", "-o", "../data/hello"}
2019-10-20 22:42:26 +02:00
exitCode := shared.Compile(args, "clang")
if exitCode != 0 {
t.Errorf("Compile of %v returned %v\n", args, exitCode)
} else {
fmt.Println("Compiled OK")
}
args = []string{"get-bc", "-v", "../data/hello"}
exitCode = shared.Extract(args)
if exitCode != 0 {
t.Errorf("Extraction of %v returned %v\n", args, exitCode)
} else {
fmt.Println("Extraction OK")
}
2019-10-20 22:42:26 +02:00
}