summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2014-03-29 14:19:55 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2014-03-29 14:19:55 +0000
commitaf3698066a1ea2e5ab4cc08ae9a59620cf18adb7 (patch)
tree6611f457cde58103bfc8f8c9005b7437ca7a2c0b /clang/test/CodeGen
parent238b508aafd6199a98c09e5a600452e3496f03c3 (diff)
downloadbcm5719-llvm-af3698066a1ea2e5ab4cc08ae9a59620cf18adb7.tar.gz
bcm5719-llvm-af3698066a1ea2e5ab4cc08ae9a59620cf18adb7.zip
CodeGen: Don't crash when replacing functions
The peculiarities of C99 create scenario where an LLVM IR function declaration may need to be replaced with a definition baring a different type because the prototype and definition are not required to agree. However, we were not properly deferring this when it occurred. This fixes PR19280. llvm-svn: 205099
Diffstat (limited to 'clang/test/CodeGen')
-rw-r--r--clang/test/CodeGen/inline2.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/test/CodeGen/inline2.c b/clang/test/CodeGen/inline2.c
index 670ae201f9b..84cd4db0277 100644
--- a/clang/test/CodeGen/inline2.c
+++ b/clang/test/CodeGen/inline2.c
@@ -39,6 +39,9 @@ extern int f7(void) { return 0; }
// CHECK-GNU89-LABEL: define i32 @fA()
inline int fA(void) { return 0; }
+// CHECK-GNU89-LABEL: define i32 @fB()
+inline int fB() { return 0; }
+
// CHECK-GNU89-LABEL: define available_externally i32 @f4()
// CHECK-C99-LABEL: define i32 @f4()
int f4(void);
@@ -56,7 +59,11 @@ extern inline int f9(void) { return 0; }
// CHECK-C99-LABEL: define available_externally i32 @fA()
+// CHECK-C99-LABEL: define i32 @fB()
+
int test_all() {
return f0() + f1() + f2() + f3() + f4() + f5() + f6() + f7() + f8() + f9()
- + fA();
+ + fA() + fB();
}
+
+int fB(void);
OpenPOWER on IntegriCloud