summaryrefslogtreecommitdiff
path: root/test/CodeGen/pass-object-size.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/pass-object-size.c')
-rw-r--r--test/CodeGen/pass-object-size.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/CodeGen/pass-object-size.c b/test/CodeGen/pass-object-size.c
index 1ad3f853ca6d..6e2bc2090eda 100644
--- a/test/CodeGen/pass-object-size.c
+++ b/test/CodeGen/pass-object-size.c
@@ -351,3 +351,18 @@ void test13() {
ObjectSize0(++p);
ObjectSize0(p++);
}
+
+// There was a bug where variadic functions with pass_object_size would cause
+// problems in the form of failed assertions.
+void my_sprintf(char *const c __attribute__((pass_object_size(0))), ...) {}
+
+// CHECK-LABEL: define void @test14
+void test14(char *c) {
+ // CHECK: @llvm.objectsize
+ // CHECK: call void (i8*, i64, ...) @my_sprintf
+ my_sprintf(c);
+
+ // CHECK: @llvm.objectsize
+ // CHECK: call void (i8*, i64, ...) @my_sprintf
+ my_sprintf(c, 1, 2, 3);
+}