xref: /llvm-project/clang/test/Analysis/gh-issue-89185.c (revision efe91cf78bccda90637c817e3e592b5f34e891d0)
1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -analyzer-output text -verify %s
2 
3 void clang_analyzer_warnIfReached(void);
4 
5 // https://github.com/llvm/llvm-project/issues/89185
binding_to_label_loc()6 void binding_to_label_loc() {
7   char *b = &&MyLabel; // expected-note {{'b' initialized here}}
8 MyLabel:
9   *b = 0;
10   // expected-warning@-1 {{Dereference of the address of a label}}
11   // expected-note@-2    {{Dereference of the address of a label}}
12   clang_analyzer_warnIfReached(); // no-warning: Unreachable due to fatal error.
13 }
14