[cfe-commits] r62916 - in /cfe/trunk/utils/ABITest: TypeGen.py return-types/ return-types/Makefile

Daniel Dunbar daniel at zuster.org
Sat Jan 24 00:43:22 PST 2009


Author: ddunbar
Date: Sat Jan 24 02:43:22 2009
New Revision: 62916

URL: http://llvm.org/viewvc/llvm-project?rev=62916&view=rev
Log:
Add simple make based harness for running ABI tests.

Added:
    cfe/trunk/utils/ABITest/return-types/   (with props)
    cfe/trunk/utils/ABITest/return-types/Makefile
Modified:
    cfe/trunk/utils/ABITest/TypeGen.py

Modified: cfe/trunk/utils/ABITest/TypeGen.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/ABITest/TypeGen.py?rev=62916&r1=62915&r2=62916&view=diff

==============================================================================
--- cfe/trunk/utils/ABITest/TypeGen.py (original)
+++ cfe/trunk/utils/ABITest/TypeGen.py Sat Jan 24 02:43:22 2009
@@ -6,6 +6,10 @@
 
 #  - struct improvements (bitfields, flexible arrays, packed &
 #    unpacked, alignment)
+#  - objective-c qualified id
+#  - anonymous / transparent unions
+#  - VLAs
+#  - block types
 
 ###
 # Actual type types

Propchange: cfe/trunk/utils/ABITest/return-types/

------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Jan 24 02:43:22 2009
@@ -0,0 +1 @@
+test.*

Added: cfe/trunk/utils/ABITest/return-types/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/ABITest/return-types/Makefile?rev=62916&view=auto

==============================================================================
--- cfe/trunk/utils/ABITest/return-types/Makefile (added)
+++ cfe/trunk/utils/ABITest/return-types/Makefile Sat Jan 24 02:43:22 2009
@@ -0,0 +1,124 @@
+# Usage: make test.N.report 
+#
+# COUNT can be over-ridden to change the number of tests generated per
+# file, and TESTARGS is used to change the type generation. Make sure
+# to 'make clean' after changing either of these parameters.
+
+ABITESTGEN := ../ABITestGen.py
+TESTARGS := --max-args 0 --no-vector --no-complex --no-union
+COUNT := 100
+
+CFLAGS := -std=gnu99
+
+X_COMPILER := llvm-gcc
+X_LL_CFLAGS := -emit-llvm -S
+Y_COMPILER := clang
+Y_LL_CFLAGS := -emit-llvm
+CC := gcc
+
+X_CFLAGS := -m32
+Y_CFLAGS := -arch i386
+CC_CFLAGS := -m32
+
+.PHONY: test.%.report
+test.%.report: test.%.xx.diff test.%.xy.diff test.%.yx.diff test.%.yy.diff
+	@for t in $^; do \
+		if [ -s $$t ]; then \
+			echo "TEST $*: $$t failed"; \
+		fi; \
+	done
+
+.PHONY: test.%.build
+test.%.build: test.%.ref test.%.xx test.%.xy test.%.yx test.%.yy test.%.x.defs test.%.y.defs
+	@true
+
+###
+
+.PRECIOUS: test.%.xx.diff
+test.%.xx.diff: test.%.ref.out test.%.xx.out
+	-diff $^ > $@
+.PRECIOUS: test.%.xy.diff
+test.%.xy.diff: test.%.ref.out test.%.xy.out
+	-diff $^ > $@
+.PRECIOUS: test.%.yx.diff
+test.%.yx.diff: test.%.ref.out test.%.yx.out
+	-diff $^ > $@
+.PRECIOUS: test.%.yy.diff
+test.%.yy.diff: test.%.ref.out test.%.yy.out
+	-diff $^ > $@
+.PRECIOUS: test.%.defs.diff
+test.%.defs.diff: test.%.x.defs test.%.y.defs
+	zipdifflines \
+	  --replace "%struct.T[0-9]+" "%struct.s" \
+	  --replace "byval align [0-9]+" "byval" \
+	  $^ > $@
+
+.PRECIOUS: test.%.out
+test.%.out: test.%
+	-./$< > $@
+
+.PRECIOUS: test.%.ref
+test.%.ref: test.%.driver.ref.o test.%.a.ref.o test.%.b.ref.o
+	$(CC) $(CFLAGS) $(CC_CFLAGS) -o $@ $^
+.PRECIOUS: test.%.xx
+test.%.xx: test.%.driver.ref.o test.%.a.x.o test.%.b.x.o
+	$(CC) $(CFLAGS) $(CC_CFLAGS) -o $@ $^
+.PRECIOUS: test.%.xy
+test.%.xy: test.%.driver.ref.o test.%.a.x.o test.%.b.y.o
+	$(CC) $(CFLAGS) $(CC_CFLAGS) -o $@ $^
+.PRECIOUS: test.%.yx
+test.%.yx: test.%.driver.ref.o test.%.a.y.o test.%.b.x.o
+	$(CC) $(CFLAGS) $(CC_CFLAGS) -o $@ $^
+.PRECIOUS: test.%.yy
+test.%.yy: test.%.driver.ref.o test.%.a.y.o test.%.b.y.o
+	$(CC) $(CFLAGS) $(CC_CFLAGS) -o $@ $^
+
+.PRECIOUS: test.%.ref.o
+test.%.ref.o: test.%.c
+	$(CC) -c $(CFLAGS) $(CC_CFLAGS) -o $@ $<
+.PRECIOUS: test.%.x.o
+test.%.x.o: test.%.c
+	$(X_COMPILER) -c $(CFLAGS) $(X_CFLAGS) -o $@ $<
+.PRECIOUS: test.%.y.o
+test.%.y.o: test.%.c
+	$(Y_COMPILER) -S $(CFLAGS) $(Y_CFLAGS) -o $@.s $<
+	as $(Y_CFLAGS) -o $@ $@.s
+
+.PRECIOUS: test.%.x.defs
+test.%.x.defs: test.%.a.x.ll
+	grep '^define ' $< > $@
+.PRECIOUS: test.%.y.defs
+test.%.y.defs: test.%.a.y.ll
+	grep '^define ' $< > $@
+
+.PRECIOUS: test.%.a.x.ll
+test.%.a.x.ll: test.%.a.c
+	$(X_COMPILER) $(CFLAGS) $(X_LL_CFLAGS) $(X_CFLAGS) -o $@ $<
+.PRECIOUS: test.%.b.x.ll
+test.%.b.x.ll: test.%.b.c
+	$(X_COMPILER) $(CFLAGS) $(X_LL_CFLAGS) $(X_CFLAGS) -o $@ $<
+.PRECIOUS: test.%.a.y.ll
+test.%.a.y.ll: test.%.a.c
+	$(Y_COMPILER) $(CFLAGS) $(Y_LL_CFLAGS) $(Y_CFLAGS) -o $@ $<
+.PRECIOUS: test.%.b.y.ll
+test.%.b.y.ll: test.%.b.c
+	$(Y_COMPILER) $(CFLAGS) $(Y_LL_CFLAGS) $(Y_CFLAGS) -o $@ $<
+
+.PHONY: test.%.top
+test.%.top: test.%.a.c test.%.b.c test.%.driver.c
+	@true
+
+.PRECIOUS: test.%.a.c test.%.b.c test.%.driver.c
+test.%.a.c: test.%.generate
+	@true
+test.%.b.c: test.%.generate
+	@true
+test.%.driver.c: test.%.generate
+	@true
+
+.PHONY: test.%.generate
+test.%.generate: $(ABITESTGEN)
+	$(ABITESTGEN) $(TESTARGS) -o test.$*.a.c -T test.$*.b.c -D test.$*.driver.c --min=$(shell expr $* '*' $(COUNT))  --count=$(COUNT)
+
+clean:	
+	rm -f test.* *~





More information about the cfe-commits mailing list