Commit Graph

35 Commits

Author SHA1 Message Date
Brad King
9e3b559b6a Tests: Update cmake_minimum_required versions to 3.10 2024-10-03 14:18:16 -04:00
David Lindauer
531b4fe643 OrangeC: Add support for OrangeC compiler
Add compiler information modules.  Update the test suite.

Fixes: #25032
Co-authored-by: Brad King <brad.king@kitware.com>
2023-09-25 12:27:29 -04:00
Gregor Jasny
8c789bee83 AppleClang: Fix ASM compiler identification
Recent AppleClang compilers identify themselves as
`Apple clang version 14.0.3 (clang-1403.0.22.14.1)`.
2023-06-05 17:31:35 -04:00
Tom Stellard
01d05985fd Tests: Pass -fno-lto to the Assembler test when using clang 2022-06-30 22:29:18 +00:00
makise-homura
3958ed878f LCC: Add policy CMP0129 regarding interpreting LCC as GNU
Due to MCST LCC compiler identification is now changed to LCC,
there should be a way for old projects to still identify it as GNU,
as it was before.
This commits adds the policy:
CMP0129: Compiler id for MCST LCC compilers is now LCC, not GNU.
This policy controls such a behavior.
OLD behaivior is to treat LCC as GNU, NEW is to treat is as LCC.
2021-10-21 17:24:22 +03:00
makise-homura
e5d9fce03f LCC: Add dedicated support for MCST LCC compiler
Divert LCC compiler as a new one, instead of treating it as GNU.

Since old times, Elbrus C/C++/Fortran Compiler (LCC) by MCST has been
passing checks for GNU compilers, so it has been identified as GNU.
Now, with intent of seriously upstreaming its support, it has been
added as a separate LCC compiler, and its version displays not a
supported GCC version, but LCC version itself (e.g. LCC 1.25.19 instead
of GNU 7.3.0).

This commit adds its support for detection, and also converts basically
every check like 'is this compiler GNU?' to 'is this compiler GNU or
LCC?'. The only places where this check is untouched, is where it
regards other platforms where LCC is unavailable (primarily non-Linux),
and where it REALLY differs from GNU compiler.

Note: this transition may break software that are already ported to
Elbrus, but hardly relies that LCC will be detected as GNU; still such
software is not known.
2021-10-15 05:05:19 +03:00
Brad King
ae9f986da1 Tests: Update Assembler test for IntelLLVM
Enable parts of the test the same way we do for `Intel`.
2021-01-28 09:07:01 -05:00
Brad King
b6c60f14b6 macOS: Default to arm64 architecture on Apple Silicon hosts
Detect `arm64` hardware using a method that pierces Rosetta.  If
`CMAKE_OSX_ARCHITECTURES` is not set, pass explicit flags to the
toolchain to use `arm64` instead of letting the toolchain pick.

Fixes: #20989
2020-09-30 11:58:44 -04:00
Brad King
8f75912176 Tests: Enable Assembler test case when CMAKE_OSX_ARCHITECTURES has one value 2020-09-29 05:05:49 -04:00
Brad King
97de48b528 Tests: Update Assembler code generation to select MSVC runtime library
The `Assembler` test runs the C compiler in a custom command to generate
a `.s` file for the platform.  When using the GNU-like Clang variant on
Windows, ensure that the custom command includes the MSVC runtime
library selection flags for Clang.  That way the resulting `.s` file,
when assembled into a `.obj`, will tell the linker what runtime library
it needs.
2020-01-31 14:37:34 -05:00
Zsolt Parragi
417eb5739a Tests: fix some Clang failures on Windows
* Execute MSVCRuntimeLibrary tests for GNU command line mode Clang on
  Windows using the MSVC ABI
* Assembler tests should be executed with the Ninja generator
* Assembler tests shouldn't be executed with clang-cl
* Fixed a condition in the Preprocess test for clang-cl
* Adjusted the conditions on some MSVC specific tests
2019-07-09 11:30:25 -04:00
Ben Boeckel
29c3edb87a Avoid if() quoted auto-dereference
When testing CMAKE_<LANG>_COMPILER_ID values, do not explicitly
dereference or quote the variable. We want if() to auto-dereference the
variable and not its value. Also replace MATCHES with STREQUAL where
equivalent.
2014-10-20 11:49:16 -04:00
Brad King
f60797f75b Tests/Assembler: Drop -g when generating sample assembly source
Some compilers, such as Clang on OS X, do not want the -g flag for both
generating assembly code and assembling it.  Drop the -g flag from
generation of main.s in the Assembler test.
2013-11-01 10:55:58 -04:00
Brad King
ab65862417 Clang: Add separate "AppleClang" compiler id
Apple distributes their own Clang build with their own version numbers
that differ from upstream Clang.  Use the __apple_build_version__ symbol
to identify the Apple Clang compiler and report the Apple Build Version
as the fourth version component in CMAKE_<LANG>_COMPILER_VERSION.  Add
Compiler/AppleClang-<lang> and Platform/Darwin-AppleClang-<lang> modules
that simply include the upstream equivalents.

Fix comparisons of CMAKE_<LANG>_COMPILER_ID to Clang in CMake's own
source and tests to account for AppleClang.
2013-10-07 20:12:46 -04:00
Brad King
242f673829 Tests/Assembler: Use CMAKE_OSX_SYSROOT to generate .s file
On OS X if the user-provided flags do not include -isysroot and
CMAKE_OSX_SYSROOT is defined then add the proper -isysroot flag to the C
compiler invocation we use to generate the .s file.
2012-09-21 11:15:23 -04:00
Brad King
97140d3986 Tests/Assembler: Do not use assembler in universal binaries
If CMAKE_OSX_ARCHITECTURES is set then the computed assembler .s source
file may not work for all architectures.  Skip it in that case.
2012-08-15 12:55:03 -04:00
Brad King
f3477ed88c Xcode: Set ASM source language in project file (#13472)
Also teach the Assembler test to build under Xcode.

Suggested-by: Tobias Pape <tobiaspape@gmail.com>
2012-08-15 11:03:57 -04:00
Brad King
7e8471ce7b Recognize Clang ASM support (#13473)
Since commit 571dc748 (Recognize Clang C and C++ compilers, 2010-05-17)
we recognize Clang C and C++ support.  Add Compiler/Clang-ASM.cmake to
enable use of Clang for ASM too.  Also teach Assembler test to try Clang
as an assembler.

Suggested-by: Tobias Pape <tobiaspape@gmail.com>
2012-08-15 09:40:20 -04:00
Kitware Robot
9db3116226 Remove CMake-language block-end command arguments
Ancient versions of CMake required else(), endif(), and similar block
termination commands to have arguments matching the command starting the
block.  This is no longer the preferred style.

Run the following shell code:

for c in else endif endforeach endfunction endmacro endwhile; do
    echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
egrep -z -v 'Tests/CMakeTests/While-Endwhile-' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
2012-08-13 14:19:16 -04:00
Daniel R. Gomez
d6865175a7 Tests/Assembler: Assemble and link with same flags (#13314)
The test uses the C compiler as the assembler so use the C flags for ASM
too.  This is important when the flags specify the target ABI.
2012-06-18 16:21:54 -04:00
Brad King
b3ce4200dc Do not bother enabling C++ in Assembler test
This test needs only the C compiler and ASM compiler so do not enable
the C++ compiler.
2011-03-04 09:17:30 -05:00
Brad King
80f6a344fc Teach Assembler test to generate main.s at build time
Use a custom command to generate the assembly source file at build time.
Also set CMAKE_VERBOSE_MAKEFILE so the test output contains all the
build rules.  These two changes will show the entire .c -> .s -> .o and
final link commands in the test output.
2011-03-04 09:08:18 -05:00
Brad King
1dafa7498f Fix Assembler test to parse C flags string before using
Commit 1f6c6b1c (use CMAKE_C_FLAGS when generating the assembler file,
2011-03-03) added use of CMAKE_C_FLAGS to the assembler generation step.
However, this variable is meant for direct substitution into a shell
command line so we need to parse it to separate the arguments first.
2011-03-04 08:59:56 -05:00
Alex Neundorf
4139a734fa -only enable the asm test for the Intel compiler if we are under UNIX
...have to find out how to generate assembler with icl.exe

Alex
2011-03-03 23:02:12 +01:00
Alex Neundorf
1f6c6b1cc2 -use CMAKE_C_FLAGS when generating the assembler file
Alex
2011-03-03 22:56:57 +01:00
Alex Neundorf
20fe0beb7e Only try assembler support for Makefile-based generators
Alex
2011-03-01 21:19:39 +01:00
Alex Neundorf
861447097c Use a regexp instead a lot of ORs for checking the compiler ID
Alex
2011-02-24 20:56:53 +01:00
Alex Neundorf
cf8809203a The Assembler test now tests ASM for GNU, Intel, HP, XL and SunPro
Alex
2011-02-23 21:30:27 +01:00
Ken Martin
ce8810c4e7 ENH: preclean some warnings 2008-03-25 11:27:18 -04:00
Alexander Neundorf
03ea7bf2e1 BUG: fix test
Alex
2007-07-06 14:02:42 -04:00
Alexander Neundorf
ef7b647b3b COMP: OPTIONAL was missing in ENABLE_LANGUAGE()
-the assembler file seems to work for Linux and FreeBSD
-try to fix main() for HP-UX compiler

Alex
2007-07-06 08:53:16 -04:00
Alexander Neundorf
7627b96dd1 STYLE: some more output
Alex
2007-07-05 16:38:16 -04:00
Alexander Neundorf
0589ff74ae COMP: skip APPLE, since there with universal binaries the assembler file would be built for both architectures
Alex
2007-07-05 16:32:40 -04:00
Alexander Neundorf
f9fb18f875 COMP: let's see if this assembler file works also on other platforms than linux...
Alex
2007-07-05 16:11:20 -04:00
Alexander Neundorf
5021eb90b9 ENH: add a simple assembler test
Alex
2007-07-05 09:05:40 -04:00