File tree Expand file tree Collapse file tree 5 files changed +49
-8
lines changed
Expand file tree Collapse file tree 5 files changed +49
-8
lines changed Original file line number Diff line number Diff line change @@ -19,9 +19,34 @@ elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
1919 "CORE"
2020 )
2121else ()
22- add_test_pl_tests(
23- "$<TARGET_FILE:goto-cc>"
24- )
22+ find_program (CLANG_EXISTS "clang" )
23+ find_program (GCC_EXISTS "gcc" )
24+ if (CLANG_EXISTS)
25+ add_test_pl_profile(
26+ "ansi-c-clang"
27+ "$<TARGET_FILE:goto-cc> --native-compiler clang"
28+ "-C;-s;ansi-c-clang"
29+ "CORE"
30+ )
31+ endif ()
32+ if (GCC_EXISTS)
33+ add_test_pl_profile(
34+ "ansi-c-gcc"
35+ "$<TARGET_FILE:goto-cc> --native-compiler gcc"
36+ "-C;-X;fake-gcc-version;-s;ansi-c-gcc"
37+ "CORE"
38+ )
39+ add_test_pl_profile(
40+ "ansi-c-fake-gcc"
41+ "$<TARGET_FILE:goto-cc>"
42+ "-C;-I;fake-gcc-version;-s;ansi-c-fake-gcc"
43+ "CORE"
44+ )
45+ elseif (NOT CLANG_EXISTS)
46+ add_test_pl_tests(
47+ "$<TARGET_FILE:goto-cc>"
48+ )
49+ endif ()
2550
2651 add_test_pl_profile(
2752 "ansi-c-c++-front-end"
Original file line number Diff line number Diff line change @@ -23,13 +23,29 @@ endif
2323endif
2424
2525test :
26- @../test.pl -e -p -c $(exe ) $(excluded_tests )
26+ if which clang ; then \
27+ ../test.pl -e -p -c " $( exe) --native-compiler clang" $(excluded_tests ) ; \
28+ fi
29+ if which gcc ; then \
30+ ../test.pl -e -p -c " $( exe) --native-compiler gcc" $(excluded_tests ) -X fake-gcc-version && \
31+ ../test.pl -e -p -c $(exe ) $(excluded_tests ) -I fake-gcc-version ; \
32+ elif ! which clang ; then \
33+ ../test.pl -e -p -c $(exe ) $(excluded_tests ) ; \
34+ fi
2735ifneq ($(BUILD_ENV_ ) ,MSVC)
2836 @../test.pl -e -p -c "$(exe) -xc++ -D_Bool=bool" -I test-c++-front-end -s c++-front-end $(excluded_tests)
2937endif
3038
3139tests.log : ../test.pl
32- @../test.pl -e -p -c $(exe ) $(excluded_tests )
40+ if which clang ; then \
41+ ../test.pl -e -p -c " $( exe) --native-compiler clang" $(excluded_tests ) ; \
42+ fi
43+ if which gcc ; then \
44+ ../test.pl -e -p -c " $( exe) --native-compiler gcc" $(excluded_tests ) -X fake-gcc-version && \
45+ ../test.pl -e -p -c $(exe ) $(excluded_tests ) -I fake-gcc-version ; \
46+ elif ! which clang ; then \
47+ ../test.pl -e -p -c $(exe ) $(excluded_tests ) ; \
48+ fi
3349ifneq ($(BUILD_ENV_ ) ,MSVC)
3450 @../test.pl -e -p -c "$(exe) -xc++ -D_Bool=bool" -I test-c++-front-end -s c++-front-end $(excluded_tests)
3551endif
Original file line number Diff line number Diff line change 1- CORE gcc-only
1+ CORE gcc-only fake-gcc-version
22gcc-4.c
33--native-compiler ./fake-gcc-4
44^EXIT=0$
Original file line number Diff line number Diff line change 1- CORE gcc-only
1+ CORE gcc-only fake-gcc-version
22gcc-5.c
33--native-compiler ./fake-gcc-5
44^EXIT=0$
Original file line number Diff line number Diff line change 1- CORE gcc-only
1+ CORE gcc-only fake-gcc-version
22gcc-7.c
33--native-compiler ./fake-gcc-7
44^EXIT=0$
You can’t perform that action at this time.
0 commit comments