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 /**
20 * @tc.name : memclr_0100
21 * @tc.desc : Test __aeabi_memclr method
22 * @tc.level : Level 1
23 */
24 extern int __aeabi_memclr(void *dest, size_t n);
25 extern int __aeabi_memclr4(void *dest, size_t n);
26 extern int __aeabi_memclr8(void *dest, size_t n);
27
memclr_0100(void)28 void memclr_0100(void)
29 {
30 char dest[] = "__aeabi_memclr";
31 if (__aeabi_memclr(dest, sizeof(dest)) == 0) {
32 t_error("%s __aeabi_memclr", __func__);
33 }
34 }
35
36 /**
37 * @tc.name : memclr_0200S
38 * @tc.desc : Test __aeabi_memclr4 method
39 * @tc.level : Level 1
40 */
memclr_0200(void)41 void memclr_0200(void)
42 {
43 char dest[] = "__aeabi_memclr";
44 if (__aeabi_memclr4(dest, sizeof(dest)) == 0) {
45 t_error("%s __aeabi_memclr4", __func__);
46 }
47 }
48
49 /**
50 * @tc.name : memclr_0300
51 * @tc.desc : Test __aeabi_memclr8 method
52 * @tc.level : Level 1
53 */
memclr_0300(void)54 void memclr_0300(void)
55 {
56 char dest[] = "__aeabi_memclr";
57 if (__aeabi_memclr8(dest, sizeof(dest)) == 0) {
58 t_error("%s __aeabi_memclr8", __func__);
59 }
60 }
61
main()62 int main()
63 {
64 memclr_0100();
65 memclr_0200();
66 memclr_0300();
67 return t_status;
68 }