annotate clang/test/Sema/warn-unused-label.c @ 236:c4bab56944e8 llvm-original

LLVM 16
author kono
date Wed, 09 Nov 2022 17:45:10 +0900 (2022-11-09)
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -fsyntax-only -Wunused-label -verify %s
anatofuz
parents:
diff changeset
2
236
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
3 void f(void) {
150
anatofuz
parents:
diff changeset
4 a:
anatofuz
parents:
diff changeset
5 goto a;
anatofuz
parents:
diff changeset
6 b: // expected-warning{{unused}}
anatofuz
parents:
diff changeset
7 c: __attribute__((unused));
anatofuz
parents:
diff changeset
8 d: __attribute__((noreturn)); // expected-warning {{'noreturn' attribute only applies to functions}}
anatofuz
parents:
diff changeset
9 goto d;
anatofuz
parents:
diff changeset
10 return;
anatofuz
parents:
diff changeset
11 }
anatofuz
parents:
diff changeset
12
236
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
13 void PR8455(void) {
150
anatofuz
parents:
diff changeset
14 L: __attribute__((unused)) return; // ok, no semicolon required
anatofuz
parents:
diff changeset
15 }