summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2012-05-25 17:04:42 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2012-05-25 17:04:42 +0000
commit147dcd8c33258f0239baf9a02bfca846557e09f4 (patch)
treefe8927060d98a42c4f2158be7f369a7fa6379e65 /clang/test/CodeGen
parentdebb88107981694c5e16ce6030180b1ed8c98fd1 (diff)
downloadbcm5719-llvm-147dcd8c33258f0239baf9a02bfca846557e09f4.tar.gz
bcm5719-llvm-147dcd8c33258f0239baf9a02bfca846557e09f4.zip
add CodeGen support for the alloc_size attribute
llvm-svn: 157483
Diffstat (limited to 'clang/test/CodeGen')
-rw-r--r--clang/test/CodeGen/alloc_size.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/CodeGen/alloc_size.c b/clang/test/CodeGen/alloc_size.c
new file mode 100644
index 00000000000..05aa8456ee1
--- /dev/null
+++ b/clang/test/CodeGen/alloc_size.c
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
+
+void *my_recalloc(void *, unsigned, unsigned) __attribute__((alloc_size(2,3)));
+
+// CHECK: @f
+void* f() {
+ // CHECK: call i8* @my_recalloc{{.*}}, !alloc_size !0
+ return my_recalloc(0, 11, 27);
+}
+
+// CHECK: !0 = metadata !{i32 1, i32 2}
OpenPOWER on IntegriCloud