summaryrefslogtreecommitdiffstats
path: root/test/SemaObjC/warn-unreachable.m
blob: 832cbd23d27e80edb84792f49ead7d33bd6fa3ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// RUN: %clang %s -fsyntax-only -Xclang -verify -fblocks -Wunreachable-code -Wno-unused-value -Wno-covered-switch-default

// This previously triggered a warning from -Wunreachable-code because of
// a busted CFG.
typedef signed char BOOL;
BOOL radar10989084() {
  @autoreleasepool {  // no-warning
    return __objc_yes;
  }
}

// Test the warning works.
void test_unreachable() {
  return;
  return; // expected-warning {{will never be executed}}
}