-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-picked from commit 628e418df1a009e0d073545cbef3604350e7b808 Update Checked C clang compiler to latest LLVM sources, by merging the Checked C changes into recent LLVM sources. The LLVM sources are approximately at where RC1 for v8.0 was forked. Testing: - Passes all Checked C clang tests. - Passes all but 2 clang tests. Those are pre-existing failures in the LLVM sources that we're merging with.
- Loading branch information
Showing
12 changed files
with
617 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[submodule "tools/clang"] | ||
path = tools/clang | ||
url = https://github.com/Microsoft/checkedc-clang | ||
[submodule "projects/checkedc-wrapper/checkedc"] | ||
path = projects/checkedc-wrapper/checkedc | ||
url = https://github.com/Microsoft/checkedc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# This script adds the Checked C tests to the LLVM tests infrastructure, | ||
# provided that the Checked C repo exists as a subdirectory. | ||
|
||
# LLVM uses the CMake meta-build system to generate the build system. | ||
# The build system includes targets for running tests. | ||
# | ||
# The script adds a new target for running Checked C tests. | ||
# To do that, it sets up the information needed by the LIT tool. | ||
|
||
if(CHECKEDC_IN_TREE) | ||
add_subdirectory(checkedc/include) | ||
|
||
set(CHECKEDC_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) | ||
set(CHECKEDC_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) | ||
|
||
|
||
if (CMAKE_CFG_INTDIR STREQUAL ".") | ||
set(LLVM_BUILD_MODE ".") | ||
else () | ||
set(LLVM_BUILD_MODE "%(build_mode)s") | ||
endif () | ||
|
||
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} CLANG_TOOLS_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) | ||
|
||
configure_lit_site_cfg( | ||
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in | ||
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg | ||
) | ||
|
||
list(APPEND CHECKEDC_TEST_DEPS | ||
clang clang-headers checkedc-headers | ||
) | ||
|
||
if(CLANG_ENABLE_STATIC_ANALYZER) | ||
list(APPEND CLANG_TEST_DEPS | ||
clang-check | ||
) | ||
endif() | ||
|
||
set(CHECKEDC_TEST_PARAMS | ||
checkedc_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg | ||
) | ||
|
||
if( NOT CLANG_BUILT_STANDALONE ) | ||
list(APPEND CHECKEDC_TEST_DEPS | ||
llvm-config | ||
FileCheck count not | ||
opt | ||
) | ||
endif() | ||
|
||
add_custom_target(checkedc-test-depends DEPENDS ${CHECKEDC_TEST_DEPS}) | ||
|
||
add_lit_testsuite(check-checkedc "Running the Checked C regression tests" | ||
${CMAKE_CURRENT_BINARY_DIR} | ||
#LIT ${LLVM_LIT} | ||
PARAMS ${CHECKEDC_TEST_PARAMS} | ||
DEPENDS ${CHECKEDC_TEST_DEPS} | ||
ARGS ${CHECKEDC_TEST_EXTRA_ARGS} | ||
) | ||
|
||
set_target_properties(check-checkedc PROPERTIES FOLDER "Checked C tests") | ||
|
||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Summary | ||
|
||
Checked C is a research project to extend C with | ||
static and dynamic checking to detect or prevent | ||
common programming errors. | ||
|
||
This directory contains LLVM-specific files for | ||
testing the LLVM implementation of Checked C. | ||
The files include build system files and LLVM | ||
test infrastructure configuration files. | ||
|
||
Checked C is a separate project from LLVM. | ||
The specification for Checked C and the tests | ||
for Checked C reside in a separate repo on | ||
Github. To use those tests, clone the | ||
Checked C repo to this directory: | ||
|
||
git clone https://github.com/Microsoft/checkedc | ||
|
||
## Why this directory exists. | ||
|
||
You might wonder why these files were not | ||
placed directly into the Checked C repo, | ||
allowing us to elide this directory entirely. | ||
The build and test infrastructure configuration | ||
files are derived directly from existing LLVM files, | ||
so they are subject the LLVM license and copyright | ||
terms. The Checked C repo is subject to the MIT | ||
conflicting licenses in the repo, just for a few files. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Subproject commit bc45607280f8ca1c4fc3208f3409b34749c1f728 |
Oops, something went wrong.