When defining a function whose type has no prototype, make an effort
to go back and clean up existing uses of the bitcasted function. This
is not just an optimization: it is required for correctness to get
always inline functions to work, see testcases in function-attributes.c.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70971 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGen/function-attributes.c b/test/CodeGen/function-attributes.c
index b120976..ba2e4e4 100644
--- a/test/CodeGen/function-attributes.c
+++ b/test/CodeGen/function-attributes.c
@@ -47,4 +47,23 @@
void f13(void) __attribute__((pure)) __attribute__((const));
void f13(void){}
+
+// Ensure that these get inlined: rdar://6853279
+// RUN: not grep '@ai_' %t &&
+static __inline__ __attribute__((always_inline))
+int ai_1() { return 4; }
+
+static __inline__ __attribute__((always_inline))
+struct {
+ int a, b, c, d, e;
+} ai_2() { }
+
+
+int foo() {
+ ai_2();
+ return ai_1();
+}
+
+
+
// RUN: true
diff --git a/test/CodeGen/functions.c b/test/CodeGen/functions.c
index 55f580b..9855992 100644
--- a/test/CodeGen/functions.c
+++ b/test/CodeGen/functions.c
@@ -23,7 +23,7 @@
void f0() {}
void f1();
-// RUN: grep 'call void (...)\* bitcast (void ()\* @f1' %t &&
+// RUN: grep 'call void @f1()' %t &&
void f2(void) {
f1(1, 2, 3);
}