diff options
author | Joe Ranieri <jranieri@grammatech.com> | 2020-01-14 15:05:01 -0500 |
---|---|---|
committer | Joe Ranieri <jranieri@grammatech.com> | 2020-01-14 15:38:30 -0500 |
commit | 5ee616a710bcb52cf9f1f7951644d098d38e7b6a (patch) | |
tree | 49017cb32c99ed568b747217552ec30ad41ab004 /clang/test | |
parent | b53d44b17a1685e405415cd32c4b6eb89cc4c3a1 (diff) | |
download | bcm5719-llvm-5ee616a710bcb52cf9f1f7951644d098d38e7b6a.tar.gz bcm5719-llvm-5ee616a710bcb52cf9f1f7951644d098d38e7b6a.zip |
[analyzer] Fix SARIF column locations
Differential revision: https://reviews.llvm.org/D70689
Diffstat (limited to 'clang/test')
3 files changed, 82 insertions, 6 deletions
diff --git a/clang/test/Analysis/diagnostics/Inputs/expected-sarif/sarif-diagnostics-taint-test.c.sarif b/clang/test/Analysis/diagnostics/Inputs/expected-sarif/sarif-diagnostics-taint-test.c.sarif index 3275de3f894..2deb1bd90c2 100644 --- a/clang/test/Analysis/diagnostics/Inputs/expected-sarif/sarif-diagnostics-taint-test.c.sarif +++ b/clang/test/Analysis/diagnostics/Inputs/expected-sarif/sarif-diagnostics-taint-test.c.sarif @@ -13,6 +13,7 @@ ] } ], + "columnKind": "unicodeCodePoints", "results": [ { "codeFlows": [ diff --git a/clang/test/Analysis/diagnostics/Inputs/expected-sarif/sarif-multi-diagnostic-test.c.sarif b/clang/test/Analysis/diagnostics/Inputs/expected-sarif/sarif-multi-diagnostic-test.c.sarif index 88e1562539c..a54c4539708 100644 --- a/clang/test/Analysis/diagnostics/Inputs/expected-sarif/sarif-multi-diagnostic-test.c.sarif +++ b/clang/test/Analysis/diagnostics/Inputs/expected-sarif/sarif-multi-diagnostic-test.c.sarif @@ -4,7 +4,7 @@ { "artifacts": [ { - "length": 951, + "length": 1077, "location": { }, "mimeType": "text/plain", @@ -13,6 +13,7 @@ ] } ], + "columnKind": "unicodeCodePoints", "results": [ { "codeFlows": [ @@ -32,9 +33,9 @@ }, "region": { "endColumn": 6, - "endLine": 34, + "endLine": 39, "startColumn": 3, - "startLine": 34 + "startLine": 39 } } } @@ -102,9 +103,9 @@ }, "region": { "endColumn": 6, - "endLine": 35, + "endLine": 40, "startColumn": 3, - "startLine": 35 + "startLine": 40 } } } @@ -120,7 +121,7 @@ "index": 0, }, "region": { - "endColumn": 11, + "endColumn": 12, "endLine": 15, "startColumn": 3, "startLine": 15 @@ -363,6 +364,74 @@ }, "ruleId": "unix.Malloc", "ruleIndex": 3 + }, + { + "codeFlows": [ + { + "threadFlows": [ + { + "locations": [ + { + "importance": "essential", + "location": { + "message": { + "text": "'løçål' initialized to 0" + }, + "physicalLocation": { + "artifactLocation": { + "index": 0, + }, + "region": { + "endColumn": 12, + "endLine": 34, + "startColumn": 3, + "startLine": 34 + } + } + } + }, + { + "importance": "essential", + "location": { + "message": { + "text": "Division by zero" + }, + "physicalLocation": { + "artifactLocation": { + "index": 0, + }, + "region": { + "endColumn": 20, + "startColumn": 20, + "startLine": 35 + } + } + } + } + ] + } + ] + } + ], + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "index": 0, + }, + "region": { + "endColumn": 20, + "startColumn": 20, + "startLine": 35 + } + } + } + ], + "message": { + "text": "Division by zero" + }, + "ruleId": "core.DivideZero", + "ruleIndex": 2 } ], "tool": { diff --git a/clang/test/Analysis/diagnostics/sarif-multi-diagnostic-test.c b/clang/test/Analysis/diagnostics/sarif-multi-diagnostic-test.c index 99c8d2faf1c..542a8087c4f 100644 --- a/clang/test/Analysis/diagnostics/sarif-multi-diagnostic-test.c +++ b/clang/test/Analysis/diagnostics/sarif-multi-diagnostic-test.c @@ -30,11 +30,17 @@ int leak(int i) { return 0; } +int unicode() { + int løçål = 0; + /* ☃ */ return 1 / løçål; // expected-warning {{Division by zero}} +} + int main(void) { f(); g(); h(0); leak(0); + unicode(); return 0; } |