Douglas Gregor e0e9630e07 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
2011-09-06 21:41:04 +00:00

22 lines
506 B
C++

// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
// PR8839
extern "C" char memmove();
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*);