blob: b6d01ec56421851cae0147a1efc28f5adbea0739 [file] [log] [blame]
Evan Cheng5cef02d2009-03-25 16:49:31 +00001// RUN: %llvmgcc -S -emit-llvm -O1 %s -o - | grep call | grep memcpy_chk | count 3
2// RUN: %llvmgcc -S -emit-llvm -O1 %s -o - | grep call | grep {llvm.memcpy} | count 2
3
4void *t1(void *d, void *s) {
5 return __builtin___memcpy_chk(d, s, 16, 0);
6}
7
8void *t2(void *d, void *s) {
9 return __builtin___memcpy_chk(d, s, 16, 10);
10}
11
12void *t3(void *d, void *s) {
13 return __builtin___memcpy_chk(d, s, 16, 17);
14}
15
16void *t4(void *d, void *s, unsigned len) {
17 return __builtin___memcpy_chk(d, s, len, 17);
18}
19
20char buf[10];
21void *t5(void *s, unsigned len) {
22 return __builtin___memcpy_chk(buf, s, 5, __builtin_object_size(buf, 0));
23}