aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/function-attributes.c
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-05-05 06:16:31 +0000
committerChris Lattner <sabre@nondot.org>2009-05-05 06:16:31 +0000
commitbdb0132722082886558f31eccdba06ae1852c0ee (patch)
tree33deca8104f085ef2731a9e4b355ab7350112582 /test/CodeGen/function-attributes.c
parentd37d9b5bf9dd5addf6d8d3b20c4d828218c99d23 (diff)
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
Diffstat (limited to 'test/CodeGen/function-attributes.c')
-rw-r--r--test/CodeGen/function-attributes.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/CodeGen/function-attributes.c b/test/CodeGen/function-attributes.c
index b1209766d8..ba2e4e4d56 100644
--- a/test/CodeGen/function-attributes.c
+++ b/test/CodeGen/function-attributes.c
@@ -47,4 +47,23 @@ int f12(int arg) {
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