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")
19
19
"CORE"
20
20
)
21
21
else ()
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 ()
25
50
26
51
add_test_pl_profile(
27
52
"ansi-c-c++-front-end"
Original file line number Diff line number Diff line change @@ -23,13 +23,29 @@ endif
23
23
endif
24
24
25
25
test :
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
27
35
ifneq ($(BUILD_ENV_ ) ,MSVC)
28
36
@../test.pl -e -p -c "$(exe) -xc++ -D_Bool=bool" -I test-c++-front-end -s c++-front-end $(excluded_tests)
29
37
endif
30
38
31
39
tests.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
33
49
ifneq ($(BUILD_ENV_ ) ,MSVC)
34
50
@../test.pl -e -p -c "$(exe) -xc++ -D_Bool=bool" -I test-c++-front-end -s c++-front-end $(excluded_tests)
35
51
endif
Original file line number Diff line number Diff line change 1
- CORE gcc-only
1
+ CORE gcc-only fake-gcc-version
2
2
gcc-4.c
3
3
--native-compiler ./fake-gcc-4
4
4
^EXIT=0$
Original file line number Diff line number Diff line change 1
- CORE gcc-only
1
+ CORE gcc-only fake-gcc-version
2
2
gcc-5.c
3
3
--native-compiler ./fake-gcc-5
4
4
^EXIT=0$
Original file line number Diff line number Diff line change 1
- CORE gcc-only
1
+ CORE gcc-only fake-gcc-version
2
2
gcc-7.c
3
3
--native-compiler ./fake-gcc-7
4
4
^EXIT=0$
You can’t perform that action at this time.
0 commit comments