-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix patch reporting for CXXAssignConst
- Loading branch information
1 parent
194486d
commit 72d9863
Showing
3 changed files
with
37 additions
and
1 deletion.
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
32 changes: 32 additions & 0 deletions
32
tests-lit/tests/reporters/patch-reporter/cxx_assign_const/main.cpp
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,32 @@ | ||
// clang-format off | ||
void assign(int *x, int y) { | ||
x[0] = y; | ||
} | ||
|
||
int main() { | ||
int x = 15; | ||
assign(&x, 10); | ||
|
||
return 0; | ||
} | ||
|
||
/** | ||
RUN: cd %S | ||
RUN: mkdir -p %S/Output/sandbox | ||
RUN: cp %S/main.cpp %S/Output/sandbox/main.cpp | ||
RUN: cd %S/Output/sandbox | ||
/// We cd to the the test directory and compile using relative paths. | ||
RUN: cd %S; %clang_cxx %sysroot -O0 %pass_mull_ir_frontend -g Output/sandbox/main.cpp -o Output/main.cpp-ir.exe | ||
RUN: cd %S/Output; (unset TERM; %mull_runner -debug ./main.cpp-ir.exe --report-name test-ir --reporters Patches --reporters IDE; test $? = 0; ls -R %S/Output/test-ir-patches; cd %S/Output/test-ir-patches; cat `ls`) | %filecheck %s --dump-input=fail --strict-whitespace --match-full-lines | ||
CHECK:[debug] Writing Patchfile: {{.*}} | ||
CHECK:[info] Patchfiles can be found at './test{{.*}}-patches' | ||
CHECK:survived-{{.*}}main_cpp{{.*}} | ||
CHECK:--- a/{{.*}}/Output/sandbox/main.cpp 0 | ||
CHECK:+++ b/{{.*}}/Output/sandbox/main.cpp 0 | ||
CHECK:+{{\s+}}x[0] = 42; y; | ||
*/ |
3 changes: 3 additions & 0 deletions
3
tests-lit/tests/reporters/patch-reporter/cxx_assign_const/mull.yml
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,3 @@ | ||
mutators: | ||
- cxx_assign_const | ||
quiet: false |