[Qemu-devel] [PATCH v3 36/46] tests/tcg/alpha: add Alpha specific tests

Alex Bennée posted 46 patches 7 years, 6 months ago
There is a newer version of this series
[Qemu-devel] [PATCH v3 36/46] tests/tcg/alpha: add Alpha specific tests
Posted by Alex Bennée 7 years, 6 months ago
These tests are a little strange as they use their own crt.o stub
instead of the system supplied one. We also disable the multiarch
testthread test as that requires a dynamically linked build.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 tests/tcg/alpha/Makefile         | 35 --------------------------------
 tests/tcg/alpha/Makefile.target  | 32 +++++++++++++++++++++++++++++
 tests/tcg/alpha/{crt.s => crt.S} |  0
 3 files changed, 32 insertions(+), 35 deletions(-)
 delete mode 100644 tests/tcg/alpha/Makefile
 create mode 100644 tests/tcg/alpha/Makefile.target
 rename tests/tcg/alpha/{crt.s => crt.S} (100%)

diff --git a/tests/tcg/alpha/Makefile b/tests/tcg/alpha/Makefile
deleted file mode 100644
index 2b1f03d048..0000000000
--- a/tests/tcg/alpha/Makefile
+++ /dev/null
@@ -1,35 +0,0 @@
-CROSS=alpha-linux-gnu-
-CC=$(CROSS)gcc
-AS=$(CROSS)as
-
-SIM=../../alpha-linux-user/qemu-alpha
-
-CFLAGS=-O
-LINK=$(CC) -o $@ crt.o $< -nostdlib
-
-TESTS=test-cond test-cmov
-
-all: hello-alpha $(TESTS)
-
-hello-alpha: hello-alpha.o crt.o
-	$(LINK)
-
-test-cond: test-cond.o crt.o
-	$(LINK)
-
-test-cmov.o: test-cond.c
-	$(CC) -c $(CFLAGS) -DTEST_CMOV -o $@ $<
-
-test-cmov: test-cmov.o crt.o
-	$(LINK)
-
-test-ovf: test-ovf.o crt.o
-	$(LINK)
-
-check: $(TESTS)
-	for f in $(TESTS); do $(SIM) $$f || exit 1; done
-
-clean:
-	$(RM) *.o *~ hello-alpha $(TESTS)
-
-.PHONY: clean all check
diff --git a/tests/tcg/alpha/Makefile.target b/tests/tcg/alpha/Makefile.target
new file mode 100644
index 0000000000..5b573f145e
--- /dev/null
+++ b/tests/tcg/alpha/Makefile.target
@@ -0,0 +1,32 @@
+# -*- Mode: makefile -*-
+#
+# Alpha specific tweaks
+
+ALPHA_SRC=$(SRC_PATH)/tests/tcg/alpha
+VPATH+=$(ALPHA_SRC)
+
+ALPHA_TESTS=hello-alpha test-cond test-cmov test-ovf
+TESTS+=$(ALPHA_TESTS)
+
+# Our own minimal crt.o, bypassing gcc's version
+crt.o: CFLAGS+=-ffreestanding
+crt.o: crt.S
+	$(CC) $(CFLAGS) -c $< -o $@
+
+# Alternative build, linking against local crt.o
+ALPHA_BUILD=$(CC) -o $@ crt.o $< -nostdlib
+
+hello-alpha: hello-alpha.c crt.o
+	$(ALPHA_BUILD)
+
+test-cond: test-cond.c crt.o
+	$(ALPHA_BUILD)
+
+test-cmov.o: test-cond.c
+	$(CC) $(CFLAGS) -DTEST_CMOV -c $< -o $@
+
+test-cmov: test-cmov.o crt.o
+	$(ALPHA_BUILD)
+
+test-ovf: test-ovf.c crt.o
+	$(ALPHA_BUILD)
diff --git a/tests/tcg/alpha/crt.s b/tests/tcg/alpha/crt.S
similarity index 100%
rename from tests/tcg/alpha/crt.s
rename to tests/tcg/alpha/crt.S
-- 
2.17.0


Re: [Qemu-devel] [PATCH v3 36/46] tests/tcg/alpha: add Alpha specific tests
Posted by Richard Henderson 7 years, 6 months ago
On 04/24/2018 05:23 AM, Alex Bennée wrote:
> These tests are a little strange as they use their own crt.o stub
> instead of the system supplied one. We also disable the multiarch
> testthread test as that requires a dynamically linked build.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>  tests/tcg/alpha/Makefile         | 35 --------------------------------
>  tests/tcg/alpha/Makefile.target  | 32 +++++++++++++++++++++++++++++
>  tests/tcg/alpha/{crt.s => crt.S} |  0
>  3 files changed, 32 insertions(+), 35 deletions(-)
>  delete mode 100644 tests/tcg/alpha/Makefile
>  create mode 100644 tests/tcg/alpha/Makefile.target
>  rename tests/tcg/alpha/{crt.s => crt.S} (100%)

Now that you have a cross-environment, you could simply drop the crt.o.

There's nothing special in there at all; it was just someone's attempt to
produce tests *without* a fill cross-environment.


r~

Re: [Qemu-devel] [PATCH v3 36/46] tests/tcg/alpha: add Alpha specific tests
Posted by Alex Bennée 7 years, 6 months ago
Richard Henderson <rth@twiddle.net> writes:

> On 04/24/2018 05:23 AM, Alex Bennée wrote:
>> These tests are a little strange as they use their own crt.o stub
>> instead of the system supplied one. We also disable the multiarch
>> testthread test as that requires a dynamically linked build.
>>
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> ---
>>  tests/tcg/alpha/Makefile         | 35 --------------------------------
>>  tests/tcg/alpha/Makefile.target  | 32 +++++++++++++++++++++++++++++
>>  tests/tcg/alpha/{crt.s => crt.S} |  0
>>  3 files changed, 32 insertions(+), 35 deletions(-)
>>  delete mode 100644 tests/tcg/alpha/Makefile
>>  create mode 100644 tests/tcg/alpha/Makefile.target
>>  rename tests/tcg/alpha/{crt.s => crt.S} (100%)
>
> Now that you have a cross-environment, you could simply drop the crt.o.
>
> There's nothing special in there at all; it was just someone's attempt to
> produce tests *without* a fill cross-environment.

Fair enough, I'll fix it up to be more normal.

--
Alex Bennée