summaryrefslogtreecommitdiff
path: root/test/Sema/inline.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/inline.c')
-rw-r--r--test/Sema/inline.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Sema/inline.c b/test/Sema/inline.c
index c27c00efaad2..496e282ecacd 100644
--- a/test/Sema/inline.c
+++ b/test/Sema/inline.c
@@ -73,6 +73,16 @@ inline int useStaticAgain () { // expected-note 2 {{use 'static' to give inline
#pragma clang diagnostic pop
+inline void defineStaticVar() { // expected-note {{use 'static' to give inline function 'defineStaticVar' internal linkage}}
+ static const int x = 0; // ok
+ static int y = 0; // expected-warning {{non-constant static local variable in inline function may be different in different files}}
+}
+
+extern inline void defineStaticVarInExtern() {
+ static const int x = 0; // ok
+ static int y = 0; // ok
+}
+
#endif