summaryrefslogtreecommitdiffstats
path: root/tests/tcg/i386/Makefile.target
blob: c4a6f91966da7ab6eb4128ac5f32f3af8f88021a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# i386 cross compile notes

I386_SRC=$(SRC_PATH)/tests/tcg/i386

# Set search path for all sources
VPATH 		+= $(I386_SRC)

I386_SRCS=$(notdir $(wildcard $(I386_SRC)/*.c))
ALL_X86_TESTS=$(I386_SRCS:.c=)
SKIP_I386_TESTS=test-i386-ssse3
X86_64_TESTS:=$(filter test-i386-ssse3, $(ALL_X86_TESTS))

test-i386-sse-exceptions: CFLAGS += -msse4.1 -mfpmath=sse
run-test-i386-sse-exceptions: QEMU_OPTS += -cpu max
run-plugin-test-i386-sse-exceptions-%: QEMU_OPTS += -cpu max

test-i386-pcmpistri: CFLAGS += -msse4.2
run-test-i386-pcmpistri: QEMU_OPTS += -cpu max
run-plugin-test-i386-pcmpistri-%: QEMU_OPTS += -cpu max

run-test-i386-bmi2: QEMU_OPTS += -cpu max
run-plugin-test-i386-bmi2-%: QEMU_OPTS += -cpu max

#
# hello-i386 is a barebones app
#
hello-i386: CFLAGS+=-ffreestanding
hello-i386: LDFLAGS+=-nostdlib

#
# test-386 includes a couple of additional objects that need to be linked together
#

test-i386: test-i386.c test-i386-code16.S test-i386-vm86.S test-i386.h test-i386-shift.h test-i386-muldiv.h
	$(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_CFLAGS) -o $@ \
	   $(<D)/test-i386.c $(<D)/test-i386-code16.S $(<D)/test-i386-vm86.S -lm

ifeq ($(SPEED), slow)

test-i386-fprem.ref: test-i386-fprem
	$(call quiet-command, ./$< > $@,"GENREF","generating $@")

run-test-i386-fprem: TIMEOUT=60
run-test-i386-fprem: test-i386-fprem test-i386-fprem.ref
	$(call run-test,test-i386-fprem, $(QEMU) $<,"$< on $(TARGET_NAME)")
	$(call diff-out,test-i386-fprem, test-i386-fprem.ref)
else
SKIP_I386_TESTS+=test-i386-fprem
endif

# non-inline runs will trigger the duplicate instruction heuristics in libinsn.so
run-plugin-%-with-libinsn.so:
	$(call run-test, $@, $(QEMU) $(QEMU_OPTS) \
	       -plugin ../../plugin/libinsn.so$(COMMA)arg=inline \
	       -d plugin -D $*-with-libinsn.so.pout $*, \
		"$* (inline) on $(TARGET_NAME)")

# Update TESTS
I386_TESTS:=$(filter-out $(SKIP_I386_TESTS), $(ALL_X86_TESTS))
TESTS=$(MULTIARCH_TESTS) $(I386_TESTS)

# On i386 and x86_64 Linux only supports 4k pages (large pages are a different hack)
EXTRA_RUNS+=run-test-mmap-4096