1 #pragma once
2 
3 #include "../relacy/relacy_std.hpp"
4 
5 
6 struct test_memory_allocation : rl::test_suite<test_memory_allocation, 2>
7 {
threadtest_memory_allocation8     void thread(unsigned /*index*/)
9     {
10         VAR_T(int)* p1 = new VAR_T(int) (5), i1 = 5, * p11 = new VAR_T(int) (6);
11         VAR(p1[0]) = 1;
12         delete p1, delete p11;
13 
14         VAR_T(int)* p2 = new VAR_T(int) [10], i2 = 6, *p22 = new VAR_T(int) [20];
15         VAR(p2[0]) = 1;
16         delete [] p2, delete [] p22;
17 
18         void* p3 = malloc(10), *i3 = 0, *p33 = malloc(20);
19         free(p3), free(p33);
20 
21         void* p4 = malloc(sizeof(int));
22         int* i4 = new (p4) int (11);
23         free(p4);
24 
25         //RL_ASSERT(false);
26         (void)i1, (void)i2, (void)i3; (void)i4;
27     }
28 };
29 
30