Skip to content

Commit

Permalink
Add integration test for MSVC preprocessing bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexei-Barnes committed May 9, 2023
1 parent 0592bc0 commit 451245d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,11 @@ jobs:
$SCCACHE_EXE --show-stats
$SCCACHE_EXE --show-stats | grep -e "Cache hits\s*[1-9]"
- name: Compile MSVC - Proprocessing Compiler Bug
shell: bash
working-directory: ./tests/msvc-preprocessing
run: cl "@args.rsp"

- name: Stop Server
if: success() || failure()
shell: bash
Expand Down
1 change: 1 addition & 0 deletions tests/msvc-preprocessing/args.rsp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
foo.cpp -Fofoo.o -W4 -WX -Wall
15 changes: 15 additions & 0 deletions tests/msvc-preprocessing/foo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// This tests sccache's ability to handle a known bug in cl.exe
// More information: https://github.com/mozilla/sccache/issues/1725
__pragma(warning(push))
__pragma(warning(disable: 4668))
// cl.exe during compilation will correctly ignore 4668 here (undefined define)
// during preprocessing, it will not ignore 4668
// sccache must explicitly ignore this warning when preprocessing (to figure out the cache key)
#if UNDEFINED_MACRO_TRIGGERING_C4668
#error "This error should be unreachable"
#endif
__pragma(warning(pop))

int main() {
return 0;
}

0 comments on commit 451245d

Please sign in to comment.