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_memset(void *, int, size_t);
20 extern void *__aeabi_memset4(void *, int, size_t);
21 extern void *__aeabi_memset8(void *, int, size_t);
22
23 /**
24 * @tc.name : memset_0100
25 * @tc.desc : Test __aeabi_memset method
26 * @tc.level : Level 1
27 */
memset_0100(void)28 void memset_0100(void)
29 {
30 int dest[] = {1, 2, 3, 4, 5, 6, 7};
31 int src = 7;
32 int *result = __aeabi_memset(dest, src, 16);
33 if (result < 0) {
34 t_error("%s __aeabi_memset error get result is %d\n", __func__, result);
35 }
36 }
37
38 /**
39 * @tc.name : memset_0200
40 * @tc.desc : Test __aeabi_memset4 method
41 * @tc.level : Level 1
42 */
memset_0200(void)43 void memset_0200(void)
44 {
45 int dest[] = {1, 2, 3, 4, 5, 6, 7};
46 int src = 7;
47 int *result = __aeabi_memset4(dest, src, 16);
48 if (result < 0) {
49 t_error("%s __aeabi_memset4 error get result is %d\n", __func__, result);
50 }
51 }
52
53 /**
54 * @tc.name : memset_0300
55 * @tc.desc : Test __aeabi_memset8 method
56 * @tc.level : Level 1
57 */
memset_0300(void)58 void memset_0300(void)
59 {
60 int dest[] = {1, 2, 3, 4, 5, 6, 7};
61 int src = 7;
62 int *result = __aeabi_memset8(dest, src, 16);
63 if (result < 0) {
64 t_error("%s __aeabi_memset8 error get result is %d\n", __func__, result);
65 }
66 }
67
main()68 int main()
69 {
70 memset_0100();
71 memset_0200();
72 memset_0300();
73 return t_status;
74 }