brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 49305db Raw
36 lines · c
1// RUN: %clang_cc1 -fsyntax-only -Wno-strict-prototypes -verify %s2 3void blapp(int); // expected-note {{previous}}4void blapp() { } // expected-error {{conflicting types for 'blapp'}}5 6void yarp(int, ...); // expected-note {{previous}}7void yarp();         // expected-error {{conflicting types for 'yarp'}}8 9void blarg(int, ...); // expected-note {{previous}}10void blarg() {}       // expected-error {{conflicting types for 'blarg'}}11 12void blerp(short);      // expected-note {{previous}}13void blerp(x) int x; {} // expected-error {{conflicting types for 'blerp'}}14 15void foo(int); // expected-note {{previous}}16void foo();17void foo() {} // expected-error {{conflicting types for 'foo'}}18 19void glerp(int);20void glerp(x) short x; {} // Okay, promoted type is fine21 22// All these cases are okay23void derp(int);24void derp(x) int x; {}25 26void garp(int);27void garp();28void garp(x) int x; {}29 30// Ensure redeclarations that conflict with a builtin use a note which makes it31// clear that the previous declaration was a builtin.32float rintf() { // expected-warning {{incompatible redeclaration of library function 'rintf'}} \33                   expected-note {{'rintf' is a builtin with type 'float (float)'}}34  return 1.0f;35}36