]> granicus.if.org Git - clang/commitdiff
Make test independent of darwin system headers.
authorBenjamin Kramer <benny.kra@googlemail.com>
Tue, 27 Oct 2009 12:19:13 +0000 (12:19 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Tue, 27 Oct 2009 12:19:13 +0000 (12:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85232 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGen/object-size.c

index 970d11f6e1650bdac59ef4a19cf7dc3f8876f346..b6113fa0e5ab98ec28ac786cf6092c67344038e5 100644 (file)
@@ -1,6 +1,13 @@
-// RUN: clang-cc -triple x86_64-apple-darwin -S -D_FORTIFY_SOURCE=2 %s -o %t.s &&
-// RUN: FileCheck --input-file=%t.s %s
-#include <string.h>
+// RUN: clang-cc -triple x86_64-apple-darwin -S %s -o - | FileCheck %s
+
+#define strcpy(dest, src) \
+  ((__builtin_object_size(dest, 0) != -1ULL) \
+   ? __builtin___strcpy_chk (dest, src, __builtin_object_size(dest, 1)) \
+   : __inline_strcpy_chk(dest, src))
+
+static char *__inline_strcpy_chk (char *dest, const char *src) {
+  return __builtin___strcpy_chk(dest, src, __builtin_object_size(dest, 1));
+}
 
 char gbuf[63];
 char *gp;