mirror of
https://github.com/danog/gllvm.git
synced 2024-11-30 04:59:04 +01:00
Looking for data races.
This commit is contained in:
parent
dd941cd29b
commit
8e330f2e72
11
Makefile
Normal file
11
Makefile
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
install:
|
||||
go install -race github.com/SRI-CSL/gllvm/cmd/...
|
||||
|
||||
|
||||
race: install
|
||||
go test -v -race ./tests
|
||||
|
||||
|
||||
clean:
|
||||
rm -f tests/.helloworld.c.o tests/.helloworld.c.o.bc
|
8
data/helloworld.c
Normal file
8
data/helloworld.c
Normal file
@ -0,0 +1,8 @@
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
fprintf(stdout, "hello world");
|
||||
|
||||
}
|
@ -27,3 +27,7 @@ For keeping up with the Jones:
|
||||
clang -cc1 --help
|
||||
|
||||
https://clang.llvm.org/docs/ClangCommandLineReference.html
|
||||
|
||||
For fretting about race conditions:
|
||||
|
||||
go build -race cmd
|
||||
|
20
tests/entry_test.go
Normal file
20
tests/entry_test.go
Normal file
@ -0,0 +1,20 @@
|
||||
package test
|
||||
|
||||
import (
|
||||
"github.com/SRI-CSL/gllvm/shared"
|
||||
"testing"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
|
||||
func Test_basic(t *testing.T) {
|
||||
args := []string{ "../data/helloworld.c", "-o", "../data/hello" }
|
||||
|
||||
exitCode := shared.Compile(args, "clang")
|
||||
|
||||
if exitCode != 0 {
|
||||
t.Errorf("Compile of %v returned %v\n", args, exitCode)
|
||||
} else {
|
||||
fmt.Println("Compiled OK")
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user