brintos

brintos / llvm-project-archived public Read only

0
0
Text · 977 B · 40368b4 Raw
25 lines · c
1// RUN: %clang_cc1 -std=gnu89 -fsyntax-only -verify %s2// RUN: %clang_cc1 -fsyntax-only -verify %s3 4#if __STDC_VERSION__ >= 1999015#define GNU_INLINE __attribute((__gnu_inline__))6#else7#define GNU_INLINE8#endif9 10// PR525311// (same extension in C99 mode)12// GNU Extension: check that we can redefine an extern inline function13GNU_INLINE extern inline int f(int a) {return a;}14int f(int b) {return b;} // expected-note{{previous definition is here}}15// And now check that we can't redefine a normal function16int f(int c) {return c;} // expected-error{{redefinition of 'f'}}17 18// Check that we can redefine an extern inline function as a static function19GNU_INLINE extern inline int g(int a) {return a;}20static int g(int b) {return b;}21 22// Check that we ensure the types of the two definitions are the same23GNU_INLINE extern inline int h(int a) {return a;} // expected-note{{previous definition is here}}24int h(short b) {return b;}  // expected-error{{conflicting types for 'h'}}25