1- // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 6
21// RUN: %clang_cc1 -fsanitize=alloc-token -triple x86_64-linux-gnu -emit-llvm -disable-llvm-passes %s -o - | FileCheck %s
32
43typedef __typeof (sizeof (int )) size_t ;
@@ -16,29 +15,15 @@ int posix_memalign(void **memptr, size_t alignment, size_t size);
1615void * sink ;
1716
1817// CHECK-LABEL: define dso_local void @test_malloc_like(
19- // CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
20- // CHECK-NEXT: [[ENTRY:.*:]]
21- // CHECK-NEXT: [[CALL:%.*]] = call ptr @malloc(i64 noundef 4) #[[ATTR5:[0-9]+]]
22- // CHECK-NEXT: store ptr [[CALL]], ptr @sink, align 8
23- // CHECK-NEXT: [[CALL1:%.*]] = call ptr @calloc(i64 noundef 3, i64 noundef 4) #[[ATTR6:[0-9]+]]
24- // CHECK-NEXT: store ptr [[CALL1]], ptr @sink, align 8
25- // CHECK-NEXT: [[TMP0:%.*]] = load ptr, ptr @sink, align 8
26- // CHECK-NEXT: [[CALL2:%.*]] = call ptr @realloc(ptr noundef [[TMP0]], i64 noundef 8) #[[ATTR7:[0-9]+]]
27- // CHECK-NEXT: store ptr [[CALL2]], ptr @sink, align 8
28- // CHECK-NEXT: [[TMP1:%.*]] = load ptr, ptr @sink, align 8
29- // CHECK-NEXT: [[CALL3:%.*]] = call ptr @reallocarray(ptr noundef [[TMP1]], i64 noundef 5, i64 noundef 8)
30- // CHECK-NEXT: store ptr [[CALL3]], ptr @sink, align 8
31- // CHECK-NEXT: [[CALL4:%.*]] = call align 128 ptr @aligned_alloc(i64 noundef 128, i64 noundef 1024) #[[ATTR7]]
32- // CHECK-NEXT: store ptr [[CALL4]], ptr @sink, align 8
33- // CHECK-NEXT: [[CALL5:%.*]] = call align 16 ptr @memalign(i64 noundef 16, i64 noundef 256) #[[ATTR7]]
34- // CHECK-NEXT: store ptr [[CALL5]], ptr @sink, align 8
35- // CHECK-NEXT: [[CALL6:%.*]] = call ptr @valloc(i64 noundef 4096)
36- // CHECK-NEXT: store ptr [[CALL6]], ptr @sink, align 8
37- // CHECK-NEXT: [[CALL7:%.*]] = call ptr @pvalloc(i64 noundef 8192)
38- // CHECK-NEXT: store ptr [[CALL7]], ptr @sink, align 8
39- // CHECK-NEXT: [[CALL8:%.*]] = call i32 @posix_memalign(ptr noundef @sink, i64 noundef 64, i64 noundef 4)
40- // CHECK-NEXT: ret void
41- //
18+ // CHECK: call ptr @malloc(i64 noundef 4)
19+ // CHECK: call ptr @calloc(i64 noundef 3, i64 noundef 4)
20+ // CHECK: call ptr @realloc(ptr noundef {{.*}}, i64 noundef 8)
21+ // CHECK: call ptr @reallocarray(ptr noundef {{.*}}, i64 noundef 5, i64 noundef 8)
22+ // CHECK: call align 128 ptr @aligned_alloc(i64 noundef 128, i64 noundef 1024)
23+ // CHECK: call align 16 ptr @memalign(i64 noundef 16, i64 noundef 256)
24+ // CHECK: call ptr @valloc(i64 noundef 4096)
25+ // CHECK: call ptr @pvalloc(i64 noundef 8192)
26+ // CHECK: call i32 @posix_memalign(ptr noundef @sink, i64 noundef 64, i64 noundef 4)
4227void test_malloc_like () {
4328 sink = malloc (sizeof (int ));
4429 sink = calloc (3 , sizeof (int ));
0 commit comments