xref: /minix3/external/bsd/llvm/dist/clang/test/Sema/warn-unused-label.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only -Wunused-label -verify %s
2*f4a2713aSLionel Sambuc 
f()3*f4a2713aSLionel Sambuc void f() {
4*f4a2713aSLionel Sambuc   a:
5*f4a2713aSLionel Sambuc   goto a;
6*f4a2713aSLionel Sambuc   b: // expected-warning{{unused}}
7*f4a2713aSLionel Sambuc   c: __attribute__((unused));
8*f4a2713aSLionel Sambuc   d: __attribute__((noreturn)); // expected-warning {{'noreturn' attribute only applies to functions}}
9*f4a2713aSLionel Sambuc   goto d;
10*f4a2713aSLionel Sambuc   return;
11*f4a2713aSLionel Sambuc }
12*f4a2713aSLionel Sambuc 
PR8455()13*f4a2713aSLionel Sambuc void PR8455() {
14*f4a2713aSLionel Sambuc   L: __attribute__((unused)) return; // ok, no semicolon required
15*f4a2713aSLionel Sambuc }
16