xref: /llvm-project/llvm/test/Transforms/HipStdPar/allocation-no-interposition.ll (revision 0ce6255a50584863c2f462390cac6a63ccb5f136)
1; RUN: opt < %s -passes=hipstdpar-interpose-alloc -S 2>&1 | FileCheck %s
2
3; CHECK: warning: {{.*}} aligned_alloc {{.*}} cannot be interposed, missing: __hipstdpar_aligned_alloc. Tried to run the allocation interposition pass without the replacement functions available.
4; CHECK: warning: {{.*}} free {{.*}} cannot be interposed, missing: __hipstdpar_free. Tried to run the allocation interposition pass without the replacement functions available.
5; CHECK: warning: {{.*}} calloc {{.*}} cannot be interposed, missing: __hipstdpar_calloc. Tried to run the allocation interposition pass without the replacement functions available.
6; CHECK: warning: {{.*}} malloc {{.*}} cannot be interposed, missing: __hipstdpar_malloc. Tried to run the allocation interposition pass without the replacement functions available.
7; CHECK: warning: {{.*}} memalign {{.*}} cannot be interposed, missing: __hipstdpar_aligned_alloc. Tried to run the allocation interposition pass without the replacement functions available.
8; CHECK: warning: {{.*}} posix_memalign {{.*}} cannot be interposed, missing: __hipstdpar_posix_aligned_alloc. Tried to run the allocation interposition pass without the replacement functions available.
9; CHECK: warning: {{.*}} realloc {{.*}} cannot be interposed, missing: __hipstdpar_realloc. Tried to run the allocation interposition pass without the replacement functions available.
10; CHECK: warning: {{.*}} reallocarray {{.*}} cannot be interposed, missing: __hipstdpar_realloc_array. Tried to run the allocation interposition pass without the replacement functions available.
11; CHECK: warning: {{.*}} _Znwm {{.*}} cannot be interposed, missing: __hipstdpar_operator_new. Tried to run the allocation interposition pass without the replacement functions available.
12; CHECK: warning: {{.*}} _ZdlPv {{.*}} cannot be interposed, missing: __hipstdpar_operator_delete. Tried to run the allocation interposition pass without the replacement functions available.
13; CHECK: warning: {{.*}} _ZnwmSt11align_val_t {{.*}} cannot be interposed, missing: __hipstdpar_operator_new_aligned. Tried to run the allocation interposition pass without the replacement functions available.
14; CHECK: warning: {{.*}} _ZdlPvSt11align_val_t {{.*}} cannot be interposed, missing: __hipstdpar_operator_delete_aligned. Tried to run the allocation interposition pass without the replacement functions available.
15; CHECK: warning: {{.*}} _ZnwmRKSt9nothrow_t {{.*}} cannot be interposed, missing: __hipstdpar_operator_new_nothrow. Tried to run the allocation interposition pass without the replacement functions available.
16; CHECK: warning: {{.*}} _ZnwmSt11align_val_tRKSt9nothrow_t {{.*}} cannot be interposed, missing: __hipstdpar_operator_new_aligned_nothrow. Tried to run the allocation interposition pass without the replacement functions available.
17; CHECK: warning: {{.*}} _Znam {{.*}} cannot be interposed, missing: __hipstdpar_operator_new. Tried to run the allocation interposition pass without the replacement functions available.
18; CHECK: warning: {{.*}} _ZdaPv {{.*}} cannot be interposed, missing: __hipstdpar_operator_delete. Tried to run the allocation interposition pass without the replacement functions available.
19; CHECK: warning: {{.*}} _ZnamSt11align_val_t {{.*}} cannot be interposed, missing: __hipstdpar_operator_new_aligned. Tried to run the allocation interposition pass without the replacement functions available.
20; CHECK: warning: {{.*}} _ZdaPvSt11align_val_t {{.*}} cannot be interposed, missing: __hipstdpar_operator_delete_aligned. Tried to run the allocation interposition pass without the replacement functions available.
21; CHECK: warning: {{.*}} _ZnamRKSt9nothrow_t {{.*}} cannot be interposed, missing: __hipstdpar_operator_new_nothrow. Tried to run the allocation interposition pass without the replacement functions available.
22; CHECK: warning: {{.*}} _ZnamSt11align_val_tRKSt9nothrow_t {{.*}} cannot be interposed, missing: __hipstdpar_operator_new_aligned_nothrow. Tried to run the allocation interposition pass without the replacement functions available.
23; CHECK: warning: {{.*}} __libc_calloc {{.*}} cannot be interposed, missing: __hipstdpar_calloc. Tried to run the allocation interposition pass without the replacement functions available.
24; CHECK: warning: {{.*}} __libc_free {{.*}} cannot be interposed, missing: __hipstdpar_free. Tried to run the allocation interposition pass without the replacement functions available.
25; CHECK: warning: {{.*}} __libc_malloc {{.*}} cannot be interposed, missing: __hipstdpar_malloc. Tried to run the allocation interposition pass without the replacement functions available.
26; CHECK: warning: {{.*}} __libc_memalign {{.*}} cannot be interposed, missing: __hipstdpar_aligned_alloc. Tried to run the allocation interposition pass without the replacement functions available.
27
28%"struct.std::nothrow_t" = type { i8 }
29
30@_ZSt7nothrow = external global %"struct.std::nothrow_t", align 1
31
32define dso_local noundef i32 @allocs() {
33  %1 = call noalias align 8 ptr @aligned_alloc(i64 noundef 8, i64 noundef 42)
34  call void @free(ptr noundef %1)
35
36  %2 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 42)
37  call void @free(ptr noundef %2)
38
39  %3 = call noalias ptr @malloc(i64 noundef 42)
40  call void @free(ptr noundef %3)
41
42  %4 = call noalias align 8 ptr @memalign(i64 noundef 8, i64 noundef 42)
43  call void @free(ptr noundef %4)
44
45  %tmp = alloca ptr, align 8
46  %5 = call i32 @posix_memalign(ptr noundef %tmp, i64 noundef 8, i64 noundef 42)
47  call void @free(ptr noundef %tmp)
48
49  %6 = call noalias ptr @malloc(i64 noundef 42)
50  %7 = call ptr @realloc(ptr noundef %6, i64 noundef 42)
51  call void @free(ptr noundef %7)
52
53  %8 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 42)
54  %9 = call ptr @reallocarray(ptr noundef %8, i64 noundef 1, i64 noundef 42)
55  call void @free(ptr noundef %9)
56
57  %10 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 1)
58  call void @_ZdlPv(ptr noundef %10)
59
60  %11 = call noalias noundef nonnull align 8 ptr @_ZnwmSt11align_val_t(i64 noundef 1, i64 noundef 8)
61  call void @_ZdlPvSt11align_val_t(ptr noundef %11, i64 noundef 8)
62
63  %12 = call noalias noundef ptr @_ZnwmRKSt9nothrow_t(i64 noundef 1, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow)
64  call void @_ZdlPv(ptr noundef %12)
65
66  %13 = call noalias noundef align 8 ptr @_ZnwmSt11align_val_tRKSt9nothrow_t(i64 noundef 1, i64 noundef 8, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow)
67  call void @_ZdlPvSt11align_val_t(ptr noundef %13, i64 noundef 8)
68
69  %14 = call noalias noundef nonnull ptr @_Znam(i64 noundef 42)
70  call void @_ZdaPv(ptr noundef %14)
71
72  %15 = call noalias noundef nonnull align 8 ptr @_ZnamSt11align_val_t(i64 noundef 42, i64 noundef 8)
73  call void @_ZdaPvSt11align_val_t(ptr noundef %15, i64 noundef 8)
74
75  %16 = call noalias noundef ptr @_ZnamRKSt9nothrow_t(i64 noundef 42, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow)
76  call void @_ZdaPv(ptr noundef %16)
77
78  %17 = call noalias noundef align 8 ptr @_ZnamSt11align_val_tRKSt9nothrow_t(i64 noundef 42, i64 noundef 8, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow)
79  call void @_ZdaPvSt11align_val_t(ptr noundef %17, i64 noundef 8)
80
81  %18 = call ptr @calloc(i64 noundef 1, i64 noundef 42)
82  call void @free(ptr noundef %18)
83
84  %19 = call ptr @malloc(i64 noundef 42)
85  call void @free(ptr noundef %19)
86
87  %20 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 42)
88  call void @_ZdlPv(ptr noundef %20)
89
90  %21 = call noalias noundef nonnull align 8 ptr @_ZnwmSt11align_val_t(i64 noundef 42, i64 noundef 8)
91  call void @_ZdlPvSt11align_val_t(ptr noundef %21, i64 noundef 8)
92
93  %22 = call noalias noundef ptr @_ZnwmRKSt9nothrow_t(i64 noundef 42, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow)
94  call void @_ZdlPv(ptr noundef %22)
95
96  %23 = call noalias noundef align 8 ptr @_ZnwmSt11align_val_tRKSt9nothrow_t(i64 noundef 42, i64 noundef 8, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow)
97  call void @_ZdlPvSt11align_val_t(ptr noundef %23, i64 noundef 8)
98
99  %24 = call ptr @malloc(i64 noundef 42)
100  %25 = call ptr @realloc(ptr noundef %24, i64 noundef 41)
101  call void @free(ptr noundef %25)
102
103  %26 = call ptr @__libc_calloc(i64 noundef 1, i64 noundef 42)
104  call void @__libc_free(ptr noundef %26)
105
106  %27 = call ptr @__libc_malloc(i64 noundef 42)
107  call void @__libc_free(ptr noundef %27)
108
109  %28 = call ptr @__libc_memalign(i64 noundef 8, i64 noundef 42)
110  call void @__libc_free(ptr noundef %28)
111
112  ret i32 0
113}
114
115declare noalias ptr @aligned_alloc(i64 noundef, i64 noundef)
116
117declare void @free(ptr noundef)
118
119declare noalias ptr @calloc(i64 noundef, i64 noundef)
120
121declare noalias ptr @malloc(i64 noundef)
122
123declare noalias ptr @memalign(i64 noundef, i64 noundef)
124
125declare i32 @posix_memalign(ptr noundef, i64 noundef, i64 noundef)
126
127declare ptr @realloc(ptr noundef, i64 noundef)
128
129declare ptr @reallocarray(ptr noundef, i64 noundef, i64 noundef)
130
131declare noundef nonnull ptr @_Znwm(i64 noundef)
132
133declare void @_ZdlPv(ptr noundef)
134
135declare noalias noundef nonnull ptr @_ZnwmSt11align_val_t(i64 noundef, i64 noundef)
136
137declare void @_ZdlPvSt11align_val_t(ptr noundef, i64 noundef)
138
139declare noalias noundef ptr @_ZnwmRKSt9nothrow_t(i64 noundef, ptr noundef nonnull align 1 dereferenceable(1))
140
141declare noalias noundef ptr @_ZnwmSt11align_val_tRKSt9nothrow_t(i64 noundef, i64 noundef, ptr noundef nonnull align 1 dereferenceable(1))
142
143declare noundef nonnull ptr @_Znam(i64 noundef)
144
145declare void @_ZdaPv(ptr noundef)
146
147declare noalias noundef nonnull ptr @_ZnamSt11align_val_t(i64 noundef, i64 noundef)
148
149declare void @_ZdaPvSt11align_val_t(ptr noundef, i64 noundef)
150
151declare noalias noundef ptr @_ZnamRKSt9nothrow_t(i64 noundef, ptr noundef nonnull align 1 dereferenceable(1))
152
153declare noalias noundef ptr @_ZnamSt11align_val_tRKSt9nothrow_t(i64 noundef, i64 noundef, ptr noundef nonnull align 1 dereferenceable(1))
154
155declare ptr @__libc_calloc(i64 noundef, i64 noundef)
156
157declare void @__libc_free(ptr noundef)
158
159declare ptr @__libc_malloc(i64 noundef)
160
161declare ptr @__libc_memalign(i64 noundef, i64 noundef)