mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 07:11:41 +00:00
[qfcc] Add failing test for temp.component
While it specifically checks vectors, I'm pretty sure it applies to structs, too. Also, it's a little redundant with vecaddr.r, but is much more specific and far less evil in what it does (no horrible pointer shenanigans): just something that is fairly common practice.
This commit is contained in:
parent
3f389b602a
commit
218481764b
2 changed files with 24 additions and 0 deletions
|
@ -54,6 +54,7 @@ test_progs_dat=\
|
|||
tools/qfcc/test/structptr.dat \
|
||||
tools/qfcc/test/structstruct.dat \
|
||||
tools/qfcc/test/swap.dat \
|
||||
tools/qfcc/test/temp-component.dat \
|
||||
tools/qfcc/test/triangle.dat \
|
||||
tools/qfcc/test/twice-called.dat \
|
||||
tools/qfcc/test/typedef.dat \
|
||||
|
@ -618,6 +619,16 @@ tools/qfcc/test/swap.run: $(qfcc_test_run_deps)
|
|||
include $(swap_dep) # am--include-marker
|
||||
r_depfiles_remade += $(swap_dep)
|
||||
|
||||
tools_qfcc_test_temp_component_dat_SOURCES=tools/qfcc/test/temp-component.r
|
||||
temp_component_obj=$(tools_qfcc_test_temp_component_dat_SOURCES:.r=.o)
|
||||
temp_component_dep=$(call qcautodep,$(tools_qfcc_test_temp_component_dat_SOURCES))
|
||||
tools/qfcc/test/temp-component.dat$(EXEEXT): $(temp_component_obj) $(QFCC_DEP)
|
||||
$(V_QFCCLD)$(QLINK) -o $@ $(temp_component_obj)
|
||||
tools/qfcc/test/temp-component.run: $(qfcc_test_run_deps)
|
||||
@$(top_srcdir)/tools/qfcc/test/build-run $@
|
||||
include $(temp_component_dep) # am--include-marker
|
||||
r_depfiles_remade += $(temp_component_dep)
|
||||
|
||||
tools_qfcc_test_triangle_dat_SOURCES=tools/qfcc/test/triangle.r
|
||||
triangle_obj=$(tools_qfcc_test_triangle_dat_SOURCES:.r=.o)
|
||||
triangle_dep=$(call qcautodep,$(tools_qfcc_test_triangle_dat_SOURCES))
|
||||
|
|
13
tools/qfcc/test/temp-component.r
Normal file
13
tools/qfcc/test/temp-component.r
Normal file
|
@ -0,0 +1,13 @@
|
|||
float
|
||||
gety(vector v, vector z)
|
||||
{
|
||||
return (v + z).y;
|
||||
}
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
vector a = [1, 2, 3];
|
||||
vector b = [1, 2, 6];
|
||||
return gety (a, b) != 4;
|
||||
}
|
Loading…
Reference in a new issue