Fix some mishandling of the attr(gnu_inline) mode when used with
extern. Previously we would warn about it and ignore the attribute.
This is incorrect, it should be handled as a c89 "extern inline"
function. Many thanks to Matthieu Castet for pointing this out and
beating me over the head until I got it.
PR3988: extern inline function are not externally visible
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69756 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGen/inline.c b/test/CodeGen/inline.c
index 4821988..eb8ee71 100644
--- a/test/CodeGen/inline.c
+++ b/test/CodeGen/inline.c
@@ -6,6 +6,7 @@
// RUN: grep "define void @unreferenced1()" %t &&
// RUN: not grep unreferenced2 %t &&
// RUN: grep "define void @gnu_inline()" %t &&
+// RUN: grep "define available_externally void @gnu_ei_inline()" %t &&
// RUN: echo "\nC99 tests:" &&
// RUN: clang %s -emit-llvm -S -o %t -std=c99 &&
@@ -15,6 +16,7 @@
// RUN: not grep unreferenced1 %t &&
// RUN: grep "define void @unreferenced2()" %t &&
// RUN: grep "define void @gnu_inline()" %t &&
+// RUN: grep "define available_externally void @gnu_ei_inline()" %t &&
// RUN: echo "\nC++ tests:" &&
// RUN: clang %s -emit-llvm -S -o %t -std=c++98 &&
@@ -22,7 +24,8 @@
// RUN: grep "define linkonce_odr i32 @_Z3foov()" %t &&
// RUN: grep "define i32 @_Z3barv()" %t &&
// RUN: not grep unreferenced %t &&
-// RUN: grep "define void @_Z10gnu_inlinev()" %t
+// RUN: grep "define void @_Z10gnu_inlinev()" %t &&
+// RUN: grep "define available_externally void @_Z13gnu_ei_inlinev()" %t
extern inline int ei() { return 123; }
@@ -37,3 +40,8 @@
extern inline void unreferenced2() {}
__inline __attribute((__gnu_inline__)) void gnu_inline() {}
+
+// PR3988
+extern inline __attribute__((gnu_inline)) void gnu_ei_inline() {}
+void (*P)() = gnu_ei_inline;
+