Douglas Gregor | b68e399 | 2010-12-21 19:47:46 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s |
| 2 | |
| 3 | // PR8839 |
| 4 | extern "C" char memmove(); |
| 5 | |
| 6 | int main() { |
| 7 | // CHECK: call signext i8 @memmove() |
| 8 | return memmove(); |
| 9 | } |
Douglas Gregor | 1ddc9c4 | 2011-09-06 21:41:04 +0000 | [diff] [blame] | 10 | |
| 11 | // <rdar://problem/10063539> |
| 12 | |
| 13 | template<int (*Compare)(const char *s1, const char *s2)> |
| 14 | int equal(const char *s1, const char *s2) { |
| 15 | return Compare(s1, s2) == 0; |
| 16 | } |
| 17 | |
| 18 | // CHECK: define weak_odr i32 @_Z5equalIXadL_Z16__builtin_strcmpPKcS1_EEEiS1_S1_ |
| 19 | // CHECK: call i32 @strcmp |
| 20 | template int equal<&__builtin_strcmp>(const char*, const char*); |
| 21 | |