[llvm-commits] [llvm] r67699 - /llvm/branches/Apple/Dib/test/FrontendC/memcpy_chk.c

Bill Wendling isanbard at gmail.com
Wed Mar 25 11:30:16 PDT 2009


Author: void
Date: Wed Mar 25 13:30:16 2009
New Revision: 67699

URL: http://llvm.org/viewvc/llvm-project?rev=67699&view=rev
Log:
--- Merging (from foreign repository) r67691 into '.':
A    test/FrontendC/memcpy_chk.c
--- Merging (from foreign repository) r67694 into '.':
U    test/FrontendC/memcpy_chk.c

Test cases.

Added:
    llvm/branches/Apple/Dib/test/FrontendC/memcpy_chk.c

Added: llvm/branches/Apple/Dib/test/FrontendC/memcpy_chk.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/FrontendC/memcpy_chk.c?rev=67699&view=auto

==============================================================================
--- llvm/branches/Apple/Dib/test/FrontendC/memcpy_chk.c (added)
+++ llvm/branches/Apple/Dib/test/FrontendC/memcpy_chk.c Wed Mar 25 13:30:16 2009
@@ -0,0 +1,28 @@
+// RUN: %llvmgcc -S -emit-llvm -O1 %s -o - | grep call | grep memcpy_chk | count 3
+// RUN: %llvmgcc -S -emit-llvm -O1 %s -o - | grep call | grep {llvm.memcpy} | count 3
+// rdar://6716432
+
+void *t1(void *d, void *s) {
+  return __builtin___memcpy_chk(d, s, 16, 0);
+}
+
+void *t2(void *d, void *s) {
+  return __builtin___memcpy_chk(d, s, 16, 10);
+}
+
+void *t3(void *d, void *s) {
+  return __builtin___memcpy_chk(d, s, 16, 17);
+}
+
+void *t4(void *d, void *s, unsigned len) {
+  return __builtin___memcpy_chk(d, s, len, 17);
+}
+
+char buf[10];
+void *t5(void *s, unsigned len) {
+  return __builtin___memcpy_chk(buf, s, 5, __builtin_object_size(buf, 0));
+}
+
+void *t6(void *d, void *s) {
+  return __builtin___memcpy_chk(d, s, 16, __builtin_object_size(d, 0));
+}





More information about the llvm-commits mailing list