diff options
author | Mike Stump <mrs@apple.com> | 2009-07-17 01:04:31 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-07-17 01:04:31 +0000 |
commit | 48871a288031b395708406139de029fc4b4f3043 (patch) | |
tree | 403ac4b5f217228cac211cc5296dca310793462a /clang/test/Analysis/dead-stores.c | |
parent | 3d486f08cb9bd813181860371f793d692b8cbdb7 (diff) | |
download | bcm5719-llvm-48871a288031b395708406139de029fc4b4f3043.tar.gz bcm5719-llvm-48871a288031b395708406139de029fc4b4f3043.zip |
Make noreturn functions alter the CFG.
llvm-svn: 76133
Diffstat (limited to 'clang/test/Analysis/dead-stores.c')
-rw-r--r-- | clang/test/Analysis/dead-stores.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/clang/test/Analysis/dead-stores.c b/clang/test/Analysis/dead-stores.c index e644b1ead77..1aa971422a1 100644 --- a/clang/test/Analysis/dead-stores.c +++ b/clang/test/Analysis/dead-stores.c @@ -138,7 +138,8 @@ int f17() { // <rdar://problem/6506065> // The values of dead stores are only "consumed" in an enclosing expression -// what that value is actually used. In other words, don't say "Although the value stored to 'x' is used...". +// what that value is actually used. In other words, don't say "Although the +// value stored to 'x' is used...". int f18() { int x = 0; // no-warning if (1) @@ -173,3 +174,14 @@ void f20(void) { #pragma unused(x) } +void halt() __attribute__((noreturn)); +int f21() { + int x = 4; + + ++x; // expected-warning{{never read}} + if (1) { + halt(); + (void)x; + } + return 1; +} |