Changeset c76bd34 for tests/Makefile.am


Ignore:
Timestamp:
Oct 7, 2020, 4:31:43 PM (5 years ago)
Author:
Colby Alexander Parsons <caparsons@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
848439f
Parents:
ae2c27a (diff), 597c5d18 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc into master

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/Makefile.am

    rae2c27a rc76bd34  
    1111## Created On       : Sun May 31 09:08:15 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Tue Nov 20 11:18:51 2018
    14 ## Update Count     : 68
     13## Last Modified On : Sun Sep 27 19:01:41 2020
     14## Update Count     : 84
    1515###############################################################################
    1616
     
    3838# since automake doesn't have support for CFA we have to
    3939AM_CFLAGS = $(if $(test), 2> $(test), ) \
     40        -fdebug-prefix-map=$(abspath ${abs_srcdir})= \
     41        -fdebug-prefix-map=/tmp= \
     42        -fno-diagnostics-show-caret \
    4043        -g \
    4144        -Wall \
     
    5053
    5154# adjust CC to current flags
    52 CC = $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) ${ARCH_FLAGS},$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
     55CC = LC_ALL=C $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) ${ARCH_FLAGS},$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
    5356CFACC = $(CC)
    5457
     
    5861# adjusted CC but without the actual distcc call
    5962CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH) ${ARCH_FLAGS},$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
     63CFACCLINK = $(CFACCLOCAL) -quiet $(if $(test), 2> $(test), ) $($(shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g'))
    6064
    6165PRETTY_PATH=mkdir -p $(dir $(abspath ${@})) && cd ${srcdir} &&
     
    110114% : %.cfa $(CFACCBIN)
    111115        $(CFACOMPILETEST) -c -o $(abspath ${@}).o
    112         $(CFACCLOCAL) $($(shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g')) $(abspath ${@}).o -o $(abspath ${@})
     116        $(CFACCLINK) ${@}.o -o $(abspath ${@})
     117        rm $(abspath ${@}).o
    113118
    114119# implicit rule for c++ test
     
    129134        $(CFACOMPILETEST) -CFA -XCFA -p -c -fsyntax-only -o $(abspath ${@})
    130135
    131 # Use for tests where the make command is expected to succeed but the expected.txt should be compared to stderr
    132 EXPECT_STDERR = builtins/sync warnings/self-assignment
    133 $(EXPECT_STDERR): % : %.cfa $(CFACCBIN)
    134         $(CFACOMPILETEST) -c -fsyntax-only 2> $(abspath ${@})
    135 
    136136#------------------------------------------------------------------------------
    137137# CUSTOM TARGET
    138138#------------------------------------------------------------------------------
     139# tests that just validate syntax and compiler output should be compared to stderr
     140CFACOMPILE_SYNTAX = $(CFACOMPILETEST) -Wno-unused-variable -Wno-unused-label -c -fsyntax-only -o $(abspath ${@})
     141
     142SYNTAX_ONLY_CODE = expression typedefRedef variableDeclarator switch numericConstants identFuncDeclarator forall \
     143        limits nested-types stdincludes cast labelledExit array builtins/sync warnings/self-assignment
     144$(SYNTAX_ONLY_CODE): % : %.cfa $(CFACCBIN)
     145        $(CFACOMPILE_SYNTAX)
     146        $(if $(test), cp $(test) $(abspath ${@}), )
     147
    139148# expected failures
    140 # use custom target since they require a custom define and custom dependencies
     149# use custom target since they require a custom define *and* have a name that doesn't match the file
    141150alloc-ERROR : alloc.cfa $(CFACCBIN)
    142         $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
     151        $(CFACOMPILE_SYNTAX) -DERR1
     152        -cp $(test) $(abspath ${@})
    143153
    144154typedefRedef-ERR1 : typedefRedef.cfa $(CFACCBIN)
    145         $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
     155        $(CFACOMPILE_SYNTAX) -DERR1
     156        -cp $(test) $(abspath ${@})
    146157
    147158nested-types-ERR1 : nested-types.cfa $(CFACCBIN)
    148         $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
     159        $(CFACOMPILE_SYNTAX) -DERR1
     160        -cp $(test) $(abspath ${@})
    149161
    150162nested-types-ERR2 : nested-types.cfa $(CFACCBIN)
    151         $(CFACOMPILETEST) -DERR2 -c -fsyntax-only -o $(abspath ${@})
     163        $(CFACOMPILE_SYNTAX) -DERR2
     164        -cp $(test) $(abspath ${@})
    152165
    153166raii/memberCtors-ERR1 : raii/memberCtors.cfa $(CFACCBIN)
    154         $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
     167        $(CFACOMPILE_SYNTAX) -DERR1
     168        -cp $(test) $(abspath ${@})
    155169
    156170raii/ctor-autogen-ERR1 : raii/ctor-autogen.cfa $(CFACCBIN)
    157         $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
     171        $(CFACOMPILE_SYNTAX) -DERR1
     172        -cp $(test) $(abspath ${@})
    158173
    159174raii/dtor-early-exit-ERR1 : raii/dtor-early-exit.cfa $(CFACCBIN)
    160         $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
     175        $(CFACOMPILE_SYNTAX) -DERR1
     176        -cp $(test) $(abspath ${@})
    161177
    162178raii/dtor-early-exit-ERR2 : raii/dtor-early-exit.cfa $(CFACCBIN)
    163         $(CFACOMPILETEST) -DERR2 -c -fsyntax-only -o $(abspath ${@})
     179        $(CFACOMPILE_SYNTAX) -DERR2
     180        -cp $(test) $(abspath ${@})
    164181
    165182# Exception Tests
     
    170187        $(CFACCLOCAL) $($(shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g')) $(abspath ${@}).o -o $(abspath ${@})
    171188
     189# Linking tests
     190# Meta tests to make sure we see linking errors (can't compile with -O2 since it may multiply number of calls)
     191linking/linkerror : linking/linkerror.cfa $(CFACCBIN)
     192        $(CFACOMPILETEST) -O0 -c -o $(abspath ${@}).o
     193        $(CFACCLINK)  -O0 ${@}.o -o $(abspath ${@})
     194        rm $(abspath ${@}).o
     195
    172196#------------------------------------------------------------------------------
    173197# Other targets
Note: See TracChangeset for help on using the changeset viewer.