blob: 3519e1509d10b43bc942f9d0953ba879f605568b [file] [log] [blame]
Kirstóf Umanna2b6ece2020-03-20 16:45:53 +01001// RUN: %clang_analyze_cc1 -verify %s -fblocks \
2// RUN: -analyzer-checker=core \
3// RUN: -analyzer-output=text
4
5int* stack_addr_escape_base() {
6 int x = 0;
7 // FIXME: This shouldn't be tied to a modeling checker.
8 return &x; // expected-warning{{Address of stack memory associated with local variable 'x' returned to caller [core.StackAddrEscapeBase]}}
9 // expected-note-re@-1{{{{^Address of stack memory associated with local variable 'x' returned to caller$}}}}
10 // Just a regular compiler warning.
11 // expected-warning@-3{{address of stack memory associated with local variable 'x' returned}}
12}
13