summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/alloc-size.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CodeGen/alloc-size.c')
-rw-r--r--clang/test/CodeGen/alloc-size.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/CodeGen/alloc-size.c b/clang/test/CodeGen/alloc-size.c
index aa5b295b0c3..16cc0fe1181 100644
--- a/clang/test/CodeGen/alloc-size.c
+++ b/clang/test/CodeGen/alloc-size.c
@@ -357,3 +357,12 @@ void test12() {
// CHECK: store i32 -1
gi = OBJECT_SIZE_BUILTIN(my_signed_calloc(-2, 1), 0);
}
+
+void *alloc_uchar(unsigned char) __attribute__((alloc_size(1)));
+
+// CHECK-LABEL: @test13
+void test13() {
+ // If 128 were incorrectly seen as negative, the result would become -1.
+ // CHECK: store i32 128,
+ gi = OBJECT_SIZE_BUILTIN(alloc_uchar(128), 0);
+}
OpenPOWER on IntegriCloud