summaryrefslogtreecommitdiff
path: root/clang/test/CodeGenCXX/builtins.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CodeGenCXX/builtins.cpp')
-rw-r--r--clang/test/CodeGenCXX/builtins.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/builtins.cpp b/clang/test/CodeGenCXX/builtins.cpp
new file mode 100644
index 0000000..4542563
--- /dev/null
+++ b/clang/test/CodeGenCXX/builtins.cpp
@@ -0,0 +1,21 @@
+// 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*);
+