commit | fc7ff5540412f8003024e1b4940fb8408dff2ca6 | [log] [tgz] |
---|---|---|
author | Ted Kremenek <kremenek@apple.com> | Fri Jul 25 04:47:34 2008 +0000 |
committer | Ted Kremenek <kremenek@apple.com> | Fri Jul 25 04:47:34 2008 +0000 |
tree | 54aca61ae4389157b470679eac26b3b0b16117cd | |
parent | 73798892751e378cbcdef43579c1d41685091fd0 [diff] |
Don't emit 'dead initialization' warnings for variables marked 'unused'. This fixes PR 2573: http://llvm.org/bugs/show_bug.cgi?id=2573 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54009 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Analysis/dead-stores.c b/test/Analysis/dead-stores.c index dce058c..0ca2892 100644 --- a/test/Analysis/dead-stores.c +++ b/test/Analysis/dead-stores.c
@@ -77,5 +77,12 @@ return ++x; // expected-warning{{never read}} } - +int f12a(int y) { + int x = y; // expected-warning{{never read}} + return 1; +} +int f12b(int y) { + int x __attribute__((unused)) = y; // no-warning + return 1; +}