1 /* Copyright (c) 2022 Huawei Device Co., Ltd.
2 * Licensed under the Apache License, Version 2.0 (the "License");
3 * you may not use this file except in compliance with the License.
4 * You may obtain a copy of the License at
5 *
6 * http://www.apache.org/licenses/LICENSE-2.0
7 *
8 * Unless required by applicable law or agreed to in writing, software
9 * distributed under the License is distributed on an "AS IS" BASIS,
10 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 * See the License for the specific language governing permissions and
12 * limitations under the License.
13 */
14
15 #include <stdio.h>
16 #include <string.h>
17 #include "test.h"
18
19 extern void *__aeabi_memmove(void *, const void *, size_t);
20 extern void *__aeabi_memmove4(void *, const void *, size_t);
21 extern void *__aeabi_memmove8(void *, const void *, size_t);
22
23 /**
24 * @tc.name : memmove_0100
25 * @tc.desc : Test __aeabi_memmove method
26 * @tc.level : Level 1
27 */
memmove_0100(void)28 void memmove_0100(void)
29 {
30 int dest[] = {1, 2, 3, 4, 5, 6, 7};
31 int src[] = {4, 5, 6, 7};
32 int *result = __aeabi_memmove(dest, src, 16);
33 if (result < 0) {
34 t_error("%s __aeabi_memmove error get result is %d\n", __func__, result);
35 }
36 }
37
38 /**
39 * @tc.name : memmove_0200
40 * @tc.desc : Test __aeabi_memmove4 method
41 * @tc.level : Level 1
42 */
memmove_0200(void)43 void memmove_0200(void)
44 {
45 int dest[] = {1, 2, 3, 4, 5, 6, 7};
46 int src[] = {4, 5, 6, 7};
47 int *result = __aeabi_memmove4(dest, src, 16);
48 if (result < 0) {
49 t_error("%s __aeabi_memmove4 error get result is %d\n", __func__, result);
50 }
51 }
52
53 /**
54 * @tc.name : memmove_0300
55 * @tc.desc : Test __aeabi_memmove8 method
56 * @tc.level : Level 1
57 */
memmove_0300(void)58 void memmove_0300(void)
59 {
60 int dest[] = {1, 2, 3, 4, 5, 6, 7};
61 int src[] = {4, 5, 6, 7};
62 int *result = __aeabi_memmove8(dest, src, 16);
63 if (result < 0) {
64 t_error("%s __aeabi_memmove8 error get result is %d\n", __func__, result);
65 }
66 }
67
main()68 int main()
69 {
70 memmove_0100();
71 memmove_0200();
72 memmove_0300();
73 return t_status;
74 }