Fix tests after previous commit

We don't want to test for this warning, so we just fix it.
This commit is contained in:
Aaron Puchert 2020-02-14 19:41:01 +01:00
parent 2f26bc5542
commit 705306526b
4 changed files with 14 additions and 14 deletions

View File

@ -6,7 +6,7 @@
// but -Weverything forces it
#define UNUSED_MACRO1 1 // expected-warning{{macro is not used}}
void foo() // expected-warning {{no previous prototype for function}}
void foo(void) // expected-warning {{no previous prototype for function}}
// expected-note@-1{{declare 'static' if the function is not intended to be used outside of this translation unit}}
{
// A diagnostic without DefaultIgnore, and not part of a group.

View File

@ -35,19 +35,19 @@
#endif
// Testing pragma clang diagnostic with -Weverything
void ppo(){} // First test that we do not diagnose on this.
void ppo(void){} // First test that we do not diagnose on this.
#pragma clang diagnostic warning "-Weverything"
void ppp(){} // expected-warning {{no previous prototype for function 'ppp'}}
void ppp(void){} // expected-warning {{no previous prototype for function 'ppp'}}
// expected-note@-1{{declare 'static' if the function is not intended to be used outside of this translation unit}}
#pragma clang diagnostic ignored "-Weverything" // Reset it.
void ppq(){}
void ppq(void){}
#pragma clang diagnostic error "-Weverything" // Now set to error
void ppr(){} // expected-error {{no previous prototype for function 'ppr'}}
void ppr(void){} // expected-error {{no previous prototype for function 'ppr'}}
// expected-note@-1{{declare 'static' if the function is not intended to be used outside of this translation unit}}
#pragma clang diagnostic warning "-Weverything" // This should not be effective
void pps(){} // expected-error {{no previous prototype for function 'pps'}}
void pps(void){} // expected-error {{no previous prototype for function 'pps'}}
// expected-note@-1{{declare 'static' if the function is not intended to be used outside of this translation unit}}

View File

@ -18,28 +18,28 @@ int c = 'df'; // expected-warning{{multi-character character constant}}
// Test -Weverything
void ppo0(){} // first verify that we do not give anything on this
void ppo0(void){} // first verify that we do not give anything on this
#pragma clang diagnostic push // now push
#pragma clang diagnostic warning "-Weverything"
void ppr1(){} // expected-warning {{no previous prototype for function 'ppr1'}}
void ppr1(void){} // expected-warning {{no previous prototype for function 'ppr1'}}
// expected-note@-1{{declare 'static' if the function is not intended to be used outside of this translation unit}}
#pragma clang diagnostic push // push again
#pragma clang diagnostic ignored "-Weverything" // Set to ignore in this level.
void pps2(){}
void pps2(void){}
#pragma clang diagnostic warning "-Weverything" // Set to warning in this level.
void ppt2(){} // expected-warning {{no previous prototype for function 'ppt2'}}
void ppt2(void){} // expected-warning {{no previous prototype for function 'ppt2'}}
// expected-note@-1{{declare 'static' if the function is not intended to be used outside of this translation unit}}
#pragma clang diagnostic error "-Weverything" // Set to error in this level.
void ppt3(){} // expected-error {{no previous prototype for function 'ppt3'}}
void ppt3(void){} // expected-error {{no previous prototype for function 'ppt3'}}
// expected-note@-1{{declare 'static' if the function is not intended to be used outside of this translation unit}}
#pragma clang diagnostic pop // pop should go back to warning level
void pps1(){} // expected-warning {{no previous prototype for function 'pps1'}}
void pps1(void){} // expected-warning {{no previous prototype for function 'pps1'}}
// expected-note@-1{{declare 'static' if the function is not intended to be used outside of this translation unit}}
#pragma clang diagnostic pop // Another pop should disble it again
void ppu(){}
void ppu(void){}

View File

@ -7,7 +7,7 @@ int f0(int x,
return x;
}
void f1() {
void f1(void) {
(void)^(int x,
int y,
int z __attribute__((unused))) { return x; };