| /llvm-project/compiler-rt/test/hwasan/TestCases/ |
| H A D | new-test.cpp | 13 void *alloc = operator new(size); in operator_new_delete() local 14 assert(alloc != nullptr); in operator_new_delete() 15 assert(__sanitizer_get_allocated_size(alloc) == size); in operator_new_delete() 16 operator delete(alloc); in operator_new_delete() 18 alloc = operator new(size); in operator_new_delete() 19 assert(alloc != nullptr); in operator_new_delete() 20 assert(__sanitizer_get_allocated_size(alloc) == size); in operator_new_delete() 21 operator delete(alloc, size); in operator_new_delete() 25 void *alloc = operator new[](size); in operator_new_delete_array() local 26 assert(alloc ! in operator_new_delete_array() 37 void *alloc = operator new(size, align); operator_new_delete() local 51 void *alloc = operator new[](size, align); operator_new_delete_array() local 65 void *alloc = operator new(size, tag); operator_new_delete() local 72 void *alloc = operator new[](size, tag); operator_new_delete_array() local 79 void *alloc = operator new(size, align, tag); operator_new_delete() local 87 void *alloc = operator new[](size, align, tag); operator_new_delete_array() local 95 void *alloc = operator new(size, ptr); operator_new_delete() local 101 void *alloc = operator new[](size, ptr); operator_new_delete_array() local [all...] |
| /llvm-project/compiler-rt/test/asan/TestCases/Windows/ |
| H A D | heapalloc_rtl_transfer.cpp | 35 void *alloc = RtlAllocateHeap_ptr(GetProcessHeap(), in main() local 37 assert(alloc); in main() 39 assert(((char *)alloc)[i] == 0); in main() 40 ((char *)alloc)[i] = '\xcc'; in main() 44 alloc = RtlReAllocateHeap_ptr(GetProcessHeap(), in main() 45 HEAP_GENERATE_EXCEPTIONS | HEAP_ZERO_MEMORY, alloc, 500); in main() 46 assert(alloc && !__sanitizer_get_ownership(alloc) && HeapValidate(GetProcessHeap(), 0, alloc)); in main() 48 assert(((char *)alloc)[i] == '\xcc'); in main() 51 assert(((char *)alloc)[i] == 0); in main() 52 ((char *)alloc)[i] = '\xcc'; in main() [all …]
|
| H A D | heapalloc_transfer.cpp | 11 void *alloc = HeapAlloc(GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS, 100); in main() local 12 assert(alloc); in main() 14 alloc = HeapReAlloc(GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS, alloc, 100); in main() 15 assert(alloc && !__sanitizer_get_ownership(alloc) && HeapValidate(GetProcessHeap(), 0, alloc)); in main() 17 void *realloc = HeapReAlloc(GetProcessHeap(), 0, alloc, 500); in main() 18 alloc = nullptr; in main() 21 alloc = HeapReAlloc(GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS, realloc, 100); in main() 22 assert(alloc && !__sanitizer_get_ownership(alloc) && HeapValidate(GetProcessHeap(), 0, alloc)); in main()
|
| /llvm-project/libcxx/test/std/utilities/memory/specialized.algorithms/specialized.destroy/ |
| H A D | ranges_destroy.pass.cpp | 56 std::allocator<Counted> alloc; in test() local 57 using Traits = std::allocator_traits<decltype(alloc)>; in test() 60 Counted* out = Traits::allocate(alloc, N); in test() 62 Traits::construct(alloc, out + i, counter); in test() 69 Traits::deallocate(alloc, out, N); in test() 75 std::allocator<Counted> alloc; in test() local 76 using Traits = std::allocator_traits<decltype(alloc)>; in test() 79 Counted* out = Traits::allocate(alloc, N); in test() 81 Traits::construct(alloc, out + i, counter); in test() 89 Traits::deallocate(alloc, out, N); in test() [all …]
|
| H A D | ranges_destroy_at.pass.cpp | 64 std::allocator<Counted> alloc; in test() local 65 using Traits = std::allocator_traits<decltype(alloc)>; in test() 68 Counted* buffer = Traits::allocate(alloc, 2); in test() 69 Traits::construct(alloc, buffer, counter); in test() 70 Traits::construct(alloc, buffer + 1, counter); in test() 78 Traits::deallocate(alloc, buffer, 2); in test() 83 std::allocator<VirtualCountedDerived> alloc; in test() local 84 using Traits = std::allocator_traits<decltype(alloc)>; in test() 87 VirtualCountedDerived* buffer = Traits::allocate(alloc, 2); in test() 88 Traits::construct(alloc, buffer, counter); in test() [all …]
|
| H A D | destroy_at.pass.cpp | 46 Alloc alloc; in test_arrays() local 47 Array* ptr = std::allocator_traits<Alloc>::allocate(alloc, 1); in test_arrays() 52 std::allocator_traits<Alloc>::construct(alloc, std::addressof(arr[i]), &counter); in test_arrays() 59 std::allocator_traits<Alloc>::deallocate(alloc, ptr, 1); in test_arrays() 64 Alloc alloc; in test_arrays() local 65 Array* ptr = std::allocator_traits<Alloc>::allocate(alloc, 1); in test_arrays() 71 std::allocator_traits<Alloc>::construct(alloc, std::addressof(arr[i][j]), &counter); in test_arrays() 78 std::allocator_traits<Alloc>::deallocate(alloc, ptr, 1); in test_arrays() 87 Alloc alloc; in test() local 88 Counted* ptr1 = std::allocator_traits<Alloc>::allocate(alloc, 1); in test() [all …]
|
| H A D | ranges_destroy_n.pass.cpp | 52 std::allocator<Counted> alloc; in test() local 53 using Traits = std::allocator_traits<decltype(alloc)>; in test() 56 Counted* out = Traits::allocate(alloc, N); in test() 58 Traits::construct(alloc, out + i, counter); in test() 65 Traits::deallocate(alloc, out, N); in test() 83 std::allocator<Array> alloc; in test_arrays() local 84 using Traits = std::allocator_traits<decltype(alloc)>; in test_arrays() 87 Array* buffer = Traits::allocate(alloc, N); in test_arrays() 91 Traits::construct(alloc, std::addressof(array_ref[j]), counter); in test_arrays() 99 Traits::deallocate(alloc, buffer, N); in test_arrays() [all …]
|
| /llvm-project/libcxx/test/std/utilities/memory/allocator.uses/allocator.uses.construction/ |
| H A D | common.h | 30 …r UsesAllocArgT(std::allocator_arg_t, const Alloc& alloc) : allocator_constructed_(true), alloc_(a… in UsesAllocArgT() 31 constexpr UsesAllocArgT(std::allocator_arg_t, const Alloc& alloc, int& val) in UsesAllocArgT() 32 : allocator_constructed_(true), alloc_(alloc), val_ptr_(&val), ref_type_(RefType::LValue) {} in UsesAllocArgT() 33 constexpr UsesAllocArgT(std::allocator_arg_t, const Alloc& alloc, const int& val) in UsesAllocArgT() 34 … : allocator_constructed_(true), alloc_(alloc), val_ptr_(&val), ref_type_(RefType::ConstLValue) {} in UsesAllocArgT() 35 constexpr UsesAllocArgT(std::allocator_arg_t, const Alloc& alloc, int&& val) in UsesAllocArgT() 36 : allocator_constructed_(true), alloc_(alloc), val_ptr_(&val), ref_type_(RefType::RValue) {} in UsesAllocArgT() 37 constexpr UsesAllocArgT(std::allocator_arg_t, const Alloc& alloc, const int&& val) in UsesAllocArgT() 38 … : allocator_constructed_(true), alloc_(alloc), val_ptr_(&val), ref_type_(RefType::ConstRValue) {} in UsesAllocArgT() 51 constexpr UsesAllocLast(const Alloc& alloc) : allocator_constructed_(true), alloc_(alloc) {} in UsesAllocLast() [all …]
|
| /llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/ |
| H A D | alloc_function.pass.cpp | 34 void test_FunctionObject(AllocType& alloc) in test_FunctionObject() argument 46 std::function<FuncType> f2(std::allocator_arg, alloc, f); in test_FunctionObject() 58 void test_FreeFunction(AllocType& alloc) in test_FreeFunction() argument 70 std::function<FuncType> f2(std::allocator_arg, alloc, f); in test_FreeFunction() 80 void test_MemFunClass(AllocType& alloc) in test_MemFunClass() argument 92 std::function<FuncType> f2(std::allocator_arg, alloc, f); in test_MemFunClass() 102 void test_for_alloc(Alloc& alloc) in test_for_alloc() argument 105 test_FunctionObject<int()>(alloc); in test_for_alloc() 106 test_FunctionObject<int(int)>(alloc); in test_for_alloc() 107 test_FunctionObject<int(int, int)>(alloc); in test_for_alloc() [all …]
|
| H A D | alloc_F.pass.cpp | 47 void test_FunctionObject(AllocType& alloc) in test_FunctionObject() argument 54 std::function<FuncType> f2(std::allocator_arg, alloc, target); in test_FunctionObject() 67 void test_FreeFunction(AllocType& alloc) in test_FreeFunction() argument 73 std::function<FuncType> f2(std::allocator_arg, alloc, target); in test_FreeFunction() 86 void test_MemFunClass(AllocType& alloc) in test_MemFunClass() argument 92 std::function<FuncType> f2(std::allocator_arg, alloc, target); in test_MemFunClass() 102 void test_for_alloc(Alloc& alloc) { in test_for_alloc() argument 103 test_FunctionObject<int()>(alloc); in test_for_alloc() 104 test_FunctionObject<int(int)>(alloc); in test_for_alloc() 105 test_FunctionObject<int(int, int)>(alloc); in test_for_alloc() [all …]
|
| /llvm-project/libcxx/test/std/strings/basic.string/string.cons/ |
| H A D | substr_rvalue.pass.cpp | 66 test_string_pos_alloc(S orig, typename S::size_type pos, const typename S::allocator_type& alloc, S expected) { in test_string_pos_alloc() 67 S substr(std::move(orig), pos, alloc); in test_string_pos_alloc() 71 assert(substr.get_allocator() == alloc); in test_string_pos_alloc() 78 S orig, typename S::size_type pos, const typename S::allocator_type& alloc, should_throw_exception_t) { in test_string_pos_alloc() 82 [[maybe_unused]] S substr = S(std::move(orig), pos, alloc); in test_string_pos_alloc() 90 (void)alloc; in test_string_pos_alloc() 127 S orig, typename S::size_type pos, typename S::size_type n, const typename S::allocator_type& alloc, S expected) { in test_string_pos_n_alloc() 128 S substr(std::move(orig), pos, n, alloc); in test_string_pos_n_alloc() 132 assert(substr.get_allocator() == alloc); in test_string_pos_n_alloc() 142 const typename S::allocator_type& alloc, in test_string_pos_n_alloc() 65 test_string_pos_alloc(S orig,typename S::size_type pos,const typename S::allocator_type & alloc,S expected) test_string_pos_alloc() argument 77 test_string_pos_alloc(S orig,typename S::size_type pos,const typename S::allocator_type & alloc,should_throw_exception_t) test_string_pos_alloc() argument 126 test_string_pos_n_alloc(S orig,typename S::size_type pos,typename S::size_type n,const typename S::allocator_type & alloc,S expected) test_string_pos_n_alloc() argument 141 test_string_pos_n_alloc(S orig,typename S::size_type pos,typename S::size_type n,const typename S::allocator_type & alloc,should_throw_exception_t) test_string_pos_n_alloc() argument 160 test_string(const typename S::allocator_type & alloc) test_string() argument [all...] |
| /llvm-project/mlir/test/Dialect/Affine/ |
| H A D | memref-stride-calculation.mlir | 5 %1 = memref.alloc() : memref<3x4x5xf32> 7 %2 = memref.alloc(%0) : memref<3x4x?xf32> 9 %3 = memref.alloc(%0) : memref<3x?x5xf32> 11 %4 = memref.alloc(%0) : memref<?x4x5xf32> 13 %5 = memref.alloc(%0, %0) : memref<?x4x?xf32> 15 %6 = memref.alloc(%0, %0, %0) : memref<?x?x?xf32> 18 %11 = memref.alloc() : memref<3x4x5xf32, affine_map<(i, j, k)->(i, j, k)>> 20 %b11 = memref.alloc() : memref<3x4x5xf32, strided<[20, 5, 1], offset: 0>> 22 %12 = memref.alloc(%0) : memref<3x4x?xf32, affine_map<(i, j, k)->(i, j, k)>> 24 %13 = memref.alloc( [all...] |
| /llvm-project/mlir/test/Dialect/Linalg/ |
| H A D | forward-vector-transfers.mlir | 7 // CHECK: %[[ALLOC:.*]] = memref.alloc 13 %alloc = memref.alloc() : memref<32 x f32> 14 %subview = memref.subview %alloc[0][16][1] : memref<32 x f32> to memref<16 x f32> 16 …%0 = vector.transfer_read %alloc[%c0], %f0 {in_bounds = [true]} : memref<32 x f32>, vector<32 x f3… 17 memref.dealloc %alloc : memref<32 x f32> 25 // CHECK: %[[ALLOC:.*]] = memref.alloc 31 %alloc = memref.alloc() : memref<32 x f32> 32 linalg.fill ins(%f0 : f32) outs(%alloc : memref<32 x f32>) 33 %subview = memref.subview %alloc[0][16][1] : memref<32 x f32> to memref<16 x f32> 35 …%0 = vector.transfer_read %alloc[%c0], %f0 {in_bounds = [true]} : memref<32 x f32>, vector<32 x f3… [all …]
|
| /llvm-project/mlir/test/Dialect/Bufferization/Transforms/ |
| H A D | one-shot-module-bufferize-out-params.mlir | 13 // This alloc is not needed, but it is inserted due to the out-of-place 15 // promotion pass, this alloc could be avoided. 16 // CHECK: %[[alloc:.*]] = memref.alloc() {{.*}} : memref<5xf32> 17 // CHECK: memref.copy %[[arg0]], %[[alloc]] 18 // CHECK: memref.store %{{.*}}, %[[alloc]] 19 // CHECK: %[[casted:.*]] = memref.cast %[[alloc]] 27 // CHECK-NO-LAYOUT: %[[alloc:.*]] = memref.alloc() {{.*}} : memref<5xf32> 28 // CHECK-NO-LAYOUT: memref.copy %[[arg0]], %[[alloc]] 29 // CHECK-NO-LAYOUT: memref.store {{.*}}, %[[alloc]] 30 // CHECK-NO-LAYOUT: memref.copy %[[alloc]], %[[arg1]] [all …]
|
| H A D | buffer-loop-hoisting.mlir | 20 %0 = memref.alloc() : memref<2xf32> 29 // CHECK: %[[ALLOC:.*]] = memref.alloc() 40 // to any other block since the alloc has a dynamic dependency to block argument 53 %1 = memref.alloc(%0) : memref<?xf32> 64 // CHECK-NEXT: %[[ALLOC0:.*]] = memref.alloc(%[[IDX]]) 84 %0 = memref.alloc() : memref<2xf32> 87 %1 = memref.alloc() : memref<2xf32> 98 // CHECK: %[[ALLOC0:.*]] = memref.alloc() 100 // CHECK: %[[ALLOC1:.*]] = memref.alloc() 106 // The alloc position of %1 does not need to be changed and flows through [all …]
|
| /llvm-project/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/ |
| H A D | construct.pass.cpp | 87 std::allocator<A0> alloc; in test() local 88 A0* a0 = alloc.allocate(1); in test() 92 alloc.deallocate(a0, 1); in test() 97 std::allocator<A1> alloc; in test() local 98 A1* a1 = alloc.allocate(1); in test() 102 alloc.deallocate(a1, 1); in test() 107 std::allocator<A2> alloc; in test() local 108 A2* a2 = alloc.allocate(1); in test() 112 alloc.deallocate(a2, 1); in test() 118 std::allocator<VT> alloc; in test() local [all …]
|
| H A D | destroy.pass.cpp | 87 Alloc alloc; in test() local 88 CountDestructor* pool = std::allocator_traits<Alloc>::allocate(alloc, 1); in test() 90 std::allocator_traits<Alloc>::construct(alloc, pool, &destructors); in test() 93 std::allocator_traits<Alloc>::destroy(alloc, pool); in test() 96 std::allocator_traits<Alloc>::deallocate(alloc, pool, 1); in test() 101 Alloc alloc; in test() local 102 T* pool = std::allocator_traits<Alloc>::allocate(alloc, 1); in test() 103 std::allocator_traits<Alloc>::construct(alloc, pool, nullptr); in test() 104 std::allocator_traits<Alloc>::destroy(alloc, pool); in test() 105 std::allocator_traits<Alloc>::deallocate(alloc, pool, 1); in test() [all …]
|
| /llvm-project/llvm/test/CodeGen/WebAssembly/ |
| H A D | ref-type-mem2local.ll | 20 %alloc.externref = alloca %externref, align 1 22 store %externref %eref, ptr %alloc.externref, align 1 23 %eref.loaded = load %externref, ptr %alloc.externref, align 1 25 ; CHECK: %alloc.externref.var = alloca ptr addrspace(10), align 1, addrspace(1) 27 ; CHECK-NEXT: store ptr addrspace(10) %eref, ptr addrspace(1) %alloc.externref.var, align 1 28 …; CHECK-NEXT: %eref.loaded = load ptr addrspace(10), ptr addrspace(1) %alloc.externref.var, align 1 31 %alloc.funcref = alloca %funcref, align 1 33 store %funcref %fref, ptr %alloc.funcref, align 1 34 %fref.loaded = load %funcref, ptr %alloc.funcref, align 1 36 ; CHECK-NEXT: %alloc.funcref.var = alloca ptr addrspace(20), align 1, addrspace(1) [all …]
|
| /llvm-project/libcxx/test/std/input.output/syncstream/syncbuf/syncstream.syncbuf.cons/ |
| H A D | cons.pointer.allocator.pass.cpp | 32 const std::allocator<CharT> alloc; in test() local 34 Buf buf = {nullptr, alloc}; in test() 36 assert(buf.get_allocator() == alloc); in test() 44 Buf buf = {&w, alloc}; in test() 49 assert(buf.get_allocator() == alloc); in test() 59 const std::allocator<CharT> alloc; in test() local 61 Buf buf = {nullptr, alloc}; in test() 63 assert(buf.get_allocator() == alloc); in test() 71 Buf buf{&w, alloc}; in test() 76 assert(buf.get_allocator() == alloc); in test() [all …]
|
| /llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/ |
| H A D | construct_iter_iter_alloc.pass.cpp | 56 std::allocator<int> alloc; in basic_tests() local 58 cpp17_input_iterator<const int*>(an), alloc); in basic_tests() 60 forward_iterator<const int*>(an), alloc); in basic_tests() 62 bidirectional_iterator<const int*>(an), alloc); in basic_tests() 64 random_access_iterator<const int*>(an), alloc); in basic_tests() 65 test<std::vector<int> >(a, an, alloc); in basic_tests() 71 min_allocator<int> alloc; in basic_tests() local 73 cpp17_input_iterator<const int*>(a), cpp17_input_iterator<const int*>(an), alloc); in basic_tests() 76 alloc); in basic_tests() 79 bidirectional_iterator<const int*>(an), alloc); in basic_tests() [all …]
|
| /llvm-project/mlir/test/Dialect/Bufferization/Transforms/OwnershipBasedBufferDeallocation/ |
| H A D | dealloc-function-boundaries.mlir | 14 %0 = memref.alloc() : memref<4xf32> 20 // CHECK: [[ALLOC:%.*]] = memref.alloc() 28 // CHECK-DYNAMIC: [[ALLOC:%.*]] = memref.alloc() 37 %0 = memref.alloc() : memref<4xf32> 45 // CHECK-DYNAMIC: [[ALLOC:%.*]] = memref.alloc() 57 %0 = memref.alloc() : memref<2xf32> 59 %1 = memref.alloc() : memref<2xf32> 66 // CHECK: %[[FIRST_ALLOC:.*]] = memref.alloc() 68 // CHECK: %[[SECOND_ALLOC:.*]] = memref.alloc() 76 // CHECK-DYNAMIC: %[[FIRST_ALLOC:.*]] = memref.alloc() [all …]
|
| /llvm-project/offload/test/unified_shared_memory/ |
| H A D | close_modifier.c | 23 int *alloc = (int *)malloc(N * sizeof(int)); in main() local 27 alloc[i] = 10; in main() 32 host_alloc = &alloc[0]; in main() 39 map(close, to : alloc[ : N], data[ : N]) in main() 42 device_alloc = &alloc[0]; in main() 45 alloc[i] += 1; in main() 62 if (alloc[i] != 10) in main() 83 alloc[i] += 1; in main() 87 #pragma omp target map(close, tofrom : alloc[ : N], data[ : N]) in main() 92 if (alloc[i] != 11) in main() [all …]
|
| /llvm-project/mlir/test/IR/ |
| H A D | memory-ops.mlir | |
| /llvm-project/offload/test/mapping/ompx_hold/ |
| H A D | target.c | 24 #pragma omp target map(tofrom : m) map(alloc : r, d) in main() 31 #pragma omp target data map(tofrom : m) map(alloc : r, d) in main() 35 #pragma omp target map(tofrom : m) map(alloc : r, d) in main() 49 #pragma omp target map(ompx_hold, tofrom : m) map(ompx_hold, alloc : r, d) in main() 56 #pragma omp target data map(ompx_hold, tofrom : m) map(ompx_hold, alloc : r, d) in main() 60 #pragma omp target map(ompx_hold, tofrom : m) map(ompx_hold, alloc : r, d) in main() 74 #pragma omp target data map(ompx_hold, tofrom : m) map(ompx_hold, alloc : r, d) in main() 78 #pragma omp target map(tofrom : m) map(alloc : r, d) in main() 88 #pragma omp target data map(ompx_hold, tofrom : m) map(ompx_hold, alloc : r, d) in main() 92 #pragma omp target data map(ompx_hold, tofrom : m) map(ompx_hold, alloc : r, d) in main() [all …]
|
| /llvm-project/llvm/test/Transforms/Coroutines/ |
| H A D | no-suspend.ll | 14 %need.dyn.alloc = call i1 @llvm.coro.alloc(token %id) 15 br i1 %need.dyn.alloc, label %dyn.alloc, label %coro.begin 16 dyn.alloc: 18 %alloc = call ptr @malloc(i32 %size) 21 %phi = phi ptr [ null, %entry ], [ %alloc, %dyn.alloc ] 52 %need.dyn.alloc = call i1 @llvm.coro.alloc(token %id) 53 br i1 %need.dyn.alloc, label %dyn.alloc, label %coro.begin 54 dyn.alloc: 56 %alloc = call ptr @malloc(i32 %size) 59 %phi = phi ptr [ null, %entry ], [ %alloc, %dyn.alloc ] [all …]
|