summaryrefslogtreecommitdiff
path: root/test/CodeGen/blockstret.c
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-03-05 01:49:18 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-03-05 01:49:18 +0000
commitfdf30aee637038bd89c42b04d912a04de4a59133 (patch)
tree1142e4ed3aa62aefa5013e6c336a8a0a83e76978 /test/CodeGen/blockstret.c
parenta36e22399cc13100ee531adf80e9ed7b1ac8b2d4 (diff)
downloadclang-fdf30aee637038bd89c42b04d912a04de4a59133.tar.gz
Remove header file dependencies in block patch
test case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97777 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/blockstret.c')
-rw-r--r--test/CodeGen/blockstret.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/test/CodeGen/blockstret.c b/test/CodeGen/blockstret.c
index abe689ed2c..09292b809f 100644
--- a/test/CodeGen/blockstret.c
+++ b/test/CodeGen/blockstret.c
@@ -8,8 +8,8 @@
// X32: store i32 1610612736, i32* %want
// rdar://7677537
-
-#include <stdlib.h>
+int printf(const char *, ...);
+void *malloc(__SIZE_TYPE__ size);
typedef struct bigbig {
int array[512];
@@ -31,9 +31,6 @@ BigStruct_t foo(int param) {
return x;
}
-#if 1
-#include <stdio.h>
-#include <stdbool.h>
enum {
BLOCK_HAS_COPY_DISPOSE = (1 << 25),
BLOCK_HAS_CXX_OBJ = (1 << 26),
@@ -67,14 +64,14 @@ struct block_layout_abi { // can't change
const char *getBlockSignature(void *block) {
struct block_layout_abi *layout = (struct block_layout_abi *)block;
- if ((layout->flags & BLOCK_HAS_OBJC_TYPE) != BLOCK_HAS_OBJC_TYPE) return NULL;
+ if ((layout->flags & BLOCK_HAS_OBJC_TYPE) != BLOCK_HAS_OBJC_TYPE) return 0;
if (layout->flags & BLOCK_HAS_COPY_DISPOSE)
return layout->descriptor->signature;
else
return ((struct block_descriptor_small *)layout->descriptor)->signature;
}
-bool usesStruct(void *block) {
+int usesStruct(void *block) {
struct block_layout_abi *layout = (struct block_layout_abi *)block;
int want = BLOCK_HAS_OBJC_TYPE | BLOCK_USE_STRET;
return (layout->flags & want) == want;
@@ -107,4 +104,3 @@ should be non-zero: 1
should be zero: 0
*/
-#endif