mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-20 10:42:36 +00:00
Add __builtin___memcpy_chk tests.
llvm-svn: 67691
This commit is contained in:
parent
837d2365c1
commit
c288c3bf1a
23
test/FrontendC/memcpy_chk.c
Normal file
23
test/FrontendC/memcpy_chk.c
Normal file
@ -0,0 +1,23 @@
|
||||
// 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 2
|
||||
|
||||
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));
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user