mirror of
https://github.com/RPCS3/llvm.git
synced 2024-11-26 05:00:39 +00:00
Add a __builtin_object_size test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67688 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ad9ad7c827
commit
2602f436be
16
test/FrontendC/object_size.c
Normal file
16
test/FrontendC/object_size.c
Normal file
@ -0,0 +1,16 @@
|
||||
// RUN: %llvmgcc -S -emit-llvm -O1 %s -o - | grep ret | grep {\\-1} | count 1
|
||||
// RUN: %llvmgcc -S -emit-llvm -O1 %s -o - | grep ret | grep {0} | count 1
|
||||
// RUN: %llvmgcc -S -emit-llvm -O1 %s -o - | grep ret | grep {8} | count 1
|
||||
|
||||
unsigned t1(void *d) {
|
||||
return __builtin_object_size(d, 0);
|
||||
}
|
||||
|
||||
unsigned t2(void *d) {
|
||||
return __builtin_object_size(d, 2);
|
||||
}
|
||||
|
||||
char buf[8];
|
||||
unsigned t3() {
|
||||
return __builtin_object_size(buf, 0);
|
||||
}
|
Loading…
Reference in New Issue
Block a user