@@ -55,6 +55,12 @@ func TestCompiler(t *testing.T) {
5555 runPlatTests ("cortex-m-qemu" , matches , t )
5656 })
5757
58+ if runtime .GOOS == "windows" || runtime .GOOS == "darwin" {
59+ t .Run ("EmulatedHiFive1" , func (t * testing.T ) {
60+ runPlatTests ("hifive1-qemu" , matches , t )
61+ })
62+ }
63+
5864 if runtime .GOOS == "linux" {
5965 t .Run ("ARMLinux" , func (t * testing.T ) {
6066 runPlatTests ("arm--linux-gnueabihf" , matches , t )
@@ -83,6 +89,11 @@ func runPlatTests(target string, matches []string, t *testing.T) {
8389 // run all tests on host
8490 case target == "cortex-m-qemu" :
8591 // all tests are supported
92+ case target == "hifive1-qemu" :
93+ if path == filepath .Join ("testdata" , "cgo" )+ string (filepath .Separator ) {
94+ // CGo doesn't work yet for some reason.
95+ continue
96+ }
8697 default :
8798 // cross-compilation of cgo is not yet supported
8899 if path == filepath .Join ("testdata" , "cgo" )+ string (filepath .Separator ) {
@@ -203,7 +214,11 @@ func runTest(path, target string, t *testing.T) {
203214 }
204215 close (runComplete )
205216
206- if ranTooLong {
217+ if ranTooLong && target != "hifive1-qemu" {
218+ // Note: the hifive1-qemu exception is here because QEMU does
219+ // not yet include the SiFive test finisher used to exit tests.
220+ // https://github.com/sifive/riscv-qemu/commit/0eec372a36b7237caf16ec7c7646a202faba5fdb
221+ // It's a crude hack, but it makes RISC-V testable.
207222 stdout .WriteString ("--- test ran too long, terminating...\n " )
208223 }
209224
0 commit comments