diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 11:06:01 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 11:06:01 +0000 |
commit | 486754660bb926339aefcf012a3f848592babb8b (patch) | |
tree | ecdbc446c9876f4f120f701c243373cd3cb43db3 /test/Analysis/html_diagnostics/relevant_lines/switch_default.c | |
parent | 55e6d896ad333f07bb3b1ba487df214fc268a4ab (diff) |
Notes
Diffstat (limited to 'test/Analysis/html_diagnostics/relevant_lines/switch_default.c')
-rw-r--r-- | test/Analysis/html_diagnostics/relevant_lines/switch_default.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/Analysis/html_diagnostics/relevant_lines/switch_default.c b/test/Analysis/html_diagnostics/relevant_lines/switch_default.c new file mode 100644 index 0000000000000..b14e3f9fa8fd6 --- /dev/null +++ b/test/Analysis/html_diagnostics/relevant_lines/switch_default.c @@ -0,0 +1,20 @@ +enum E { + A, B, C +}; + +int f(enum E input) { + int *x = 0; + switch (input) { + case A: + return 1; + case B: + return 0; + default: + return *x; + } +} + +// RUN: rm -rf %t.output +// RUN: %clang_analyze_cc1 -analyze -analyzer-checker=core -analyzer-output html -o %t.output %s +// RUN: cat %t.output/* | FileCheck %s --match-full-lines +// CHECK: var relevant_lines = {"1": {"5": 1, "6": 1, "7": 1, "12": 1, "13": 1}}; |