mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 05:26:07 +00:00

A significant number of our tests in C accidentally use functions without prototypes. This patch converts the function signatures to have a prototype for the situations where the test is not specific to K&R C declarations. e.g., void func(); becomes void func(void); This is the first batch of tests being updated (there are a significant number of other tests left to be updated).
21 lines
822 B
C
21 lines
822 B
C
// RUN: %clang_cc1 -verify -fsyntax-only -Wno-private-extern %s
|
|
|
|
extern int l0 __attribute__((used)); // expected-warning {{'used' attribute ignored on a non-definition declaration}}
|
|
__private_extern__ int l1 __attribute__((used)); // expected-warning {{'used' attribute ignored on a non-definition declaration}}
|
|
|
|
struct __attribute__((used)) s { // expected-warning {{'used' attribute only applies to variables with non-local storage, functions, and Objective-C methods}}
|
|
int x;
|
|
};
|
|
|
|
int a __attribute__((used));
|
|
|
|
static void __attribute__((used)) f0(void) {
|
|
}
|
|
|
|
void f1(void) {
|
|
static int a __attribute__((used));
|
|
int b __attribute__((used)); // expected-warning {{'used' attribute only applies to variables with non-local storage, functions, and Objective-C methods}}
|
|
}
|
|
|
|
static void __attribute__((used)) f0(void);
|