You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this pull request, we tried to faithfully implement the highlevel idea as described in the paper (Section 5.3 of [https://www.microsoft.com/en-us/research/uploads/prod/2019/05/checkedc-post2019.pdf](https://www.microsoft.com/en-us/research/uploads/prod/2019/05/checkedc-post2019.pdf))
14
+
15
+
If you see the Section 5.3 of the paper, there depending on how a parameter to a function is **used** by the callers and **used** inside the callee, we use `itype`s or casting. To do this, we need to have two sets of constraint variables for each of the function parameters i.e., one for the calleers (i.e., as seen outside the function) and one for the function body. Once we solve the constraints we can assign `itype` or casts. Similarly for return types.
16
+
17
+
However, our old implementation had inconsistencies in inferring checked types of the function parameters and returns. Specifically, when a function do not have a corresponding declaration e.g., `static` methods,
18
+
19
+
We changed this so that irrespective of whether a function has a explicit declaration or not we always maintain two sets of constraint variables for parameters and returns.
20
+
21
+
### Function Subtyping
22
+
We introduced the support for `_Nt_array_ptrs`, this resulted in function subtyping issues as discussed in detail in: [https://gist.github.com/Machiry/962bf8c24117bc5f56a31598e6782100](https://gist.github.com/Machiry/962bf8c24117bc5f56a31598e6782100)
23
+
We implemented support for this.
24
+
25
+
### Performance Improvements
26
+
27
+
We made performance imporvements to the tool. This is mainly because of a single line change (Thanks to @rchyena) in `ConstraintVariables.cpp`:
28
+
from:
29
+
```
30
+
214: auto env = CS.getVariables();
31
+
```
32
+
to
33
+
```
34
+
214: auto &env = CS.getVariables();
35
+
```
36
+
#### Numbers for Icecast :
37
+
**New**
38
+
```
39
+
real 3m51.869s
40
+
user 3m50.132s
41
+
sys 0m0.804s
42
+
```
43
+
**Old**
44
+
```
45
+
real 6m9.581s
46
+
user 6m0.688s
47
+
sys 0m8.004s
48
+
```
49
+
In general the current version of the tool is sufficiently fast, for `libarchive` (~170K lines) it took ~10min.
Copy file name to clipboardExpand all lines: docs/checkedc/Testing.md
+80-30Lines changed: 80 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -1,32 +1,36 @@
1
1
# Testing the Checked C version of LLVM/clang
2
2
3
3
LLVM/clang have two kinds of tests: developer regression tests and extended
4
-
tests. Developer regression tests are meant to be run by developers before any
5
-
check-in and are quick to run. Extended tests are run as part of continuous
4
+
tests. Developer regression tests are meant to be run by developers before any
5
+
check-in and are quick to run. Extended tests are run as part of continuous
6
6
integration testing or for changes that require extensive testing.
7
7
8
8
## Developer regression tests
9
9
10
-
We have created a new set of developer regression tests for the Checked C extension.
11
-
We have added a new target to the build system for running the test suite: check-checkedc.
12
-
The Checked C version of clang/LLVM should pass the existing clang and LLVM
13
-
regression tests and the Checked C-specific regression tests. There should
14
-
be no unexpected test failures. A developer should confirm this before committing a change.
10
+
We have created a new set of developer regression tests for the Checked C
11
+
extension. We have added a new target to the build system for running the test
12
+
suite: check-checkedc. The Checked C version of clang/LLVM should pass the
13
+
existing clang and LLVM regression tests and the Checked C-specific regression
14
+
tests. There should be no unexpected test failures. A developer should confirm
15
+
this before committing a change.
15
16
16
-
When testing a change, the testing should be sufficient for the type of change. For changes
17
-
to parsing and typechecking, it is usually sufficient to pass the Checked C and clang tests.
17
+
When testing a change, the testing should be sufficient for the type of change.
18
+
For changes to parsing and typechecking, it is usually sufficient to pass the
19
+
Checked C and clang tests.
18
20
19
21
## Running developer regressions tests
20
22
21
23
### From Visual Studio
22
-
Load the solution and the open it using the Solution explorer (View->Solution Explorer). To run tests, you can right click and build the following targets:
24
+
Load the solution and the open it using the Solution explorer (View->Solution
25
+
Explorer). To run tests, you can right click and build the following targets:
23
26
24
27
- Checked C tests: go to _CheckedC tests->check-checkedc_
25
28
- clang tests: go to _Clang tests->check-clang_
26
29
- All LLVM and clang tests: select the check-all solution (at the top level)
27
30
28
31
### From a command shell using msbuild
29
-
Set up the build system and then change to your new object directory. Use the following commands to run tests:
32
+
Set up the build system and then change to your new object directory. Use the
33
+
following commands to run tests:
30
34
31
35
- Checked C tests: `msbuild projects\checkedc-wrapper\check-checkedc.vcxproj /p:CL_MPCount=3 /m`
0 commit comments