1 // RUN: %clang_cc1 -fsyntax-only -Wused-but-marked-unused -Wunused-function -Wunneeded-internal-declaration -verify %s
2 // RUN: %clang_cc1 -fsyntax-only -verify -Wunused %s
3 // RUN: %clang_cc1 -fsyntax-only -verify -Wall -Wno-infinite-recursion %s
6 static void f2(void) {}
7 static void f1(void) {f2();} // expected-warning{{unused}}
9 static int f0(void) { return 17; } // expected-warning{{not needed and will not be emitted}}
13 extern void f3(void) { } // expected-warning{{unused}}
15 inline static void f4(void);
16 void f4(void) { } // expected-warning{{unused}}
18 static void __attribute__((used
)) f5(void) {}
20 static void __attribute__((used
)) f6(void);
21 static void f6(void) {};
24 void f8(void(*a0
)(void));
25 void f9(void) { f8(f7
); }
26 static void f7(void) {}
28 __attribute__((unused
)) static void bar(void);
31 __attribute__((constructor
)) static void bar2(void);
34 __attribute__((destructor
)) static void bar3(void);
37 static void f10(void); // expected-warning{{unused}}
38 static void f10(void);
40 static void f11(void);
41 static void f11(void) { } // expected-warning{{unused}}
43 static void f12(void) { } // expected-warning{{unused}}
44 static void f12(void);
47 static void unused(void) { unused(); } // expected-warning{{not needed and will not be emitted}}
50 static void cleanupMalloc(char * const * const allocation
) { }
52 char * const __attribute__((cleanup(cleanupMalloc
))) a
;
57 extern void a(void) __attribute__((unused
));
58 extern void b(void) __attribute__((unused
));