summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/builtins.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-09-06 21:41:04 +0000
committerDouglas Gregor <dgregor@apple.com>2011-09-06 21:41:04 +0000
commite0e9630e0776d4692aadda33b3d23bef470efa56 (patch)
treef3d40e3472570939898e4a37542032f8057660de /clang/test/CodeGenCXX/builtins.cpp
parent1762d7cc356e4337692fa007eaadf7347f8ebc8e (diff)
downloadbcm5719-llvm-e0e9630e0776d4692aadda33b3d23bef470efa56.tar.gz
bcm5719-llvm-e0e9630e0776d4692aadda33b3d23bef470efa56.zip
When extracting the callee declaration from a call expression, be sure
to look through SubstNonTypeTemplateParmExprs. Then, update the IR generation of CallExprs to actually use CallExpr::getCalleeDecl() rather than attempting to mimick its behavior (badly). Fixes <rdar://problem/10063539>. llvm-svn: 139185
Diffstat (limited to 'clang/test/CodeGenCXX/builtins.cpp')
-rw-r--r--clang/test/CodeGenCXX/builtins.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/builtins.cpp b/clang/test/CodeGenCXX/builtins.cpp
index 0629c31015c..4542563717a 100644
--- a/clang/test/CodeGenCXX/builtins.cpp
+++ b/clang/test/CodeGenCXX/builtins.cpp
@@ -7,3 +7,15 @@ int main() {
// CHECK: call signext i8 @memmove()
return memmove();
}
+
+// <rdar://problem/10063539>
+
+template<int (*Compare)(const char *s1, const char *s2)>
+int equal(const char *s1, const char *s2) {
+ return Compare(s1, s2) == 0;
+}
+
+// CHECK: define weak_odr i32 @_Z5equalIXadL_Z16__builtin_strcmpPKcS1_EEEiS1_S1_
+// CHECK: call i32 @strcmp
+template int equal<&__builtin_strcmp>(const char*, const char*);
+
OpenPOWER on IntegriCloud