Skip to content
This repository was archived by the owner on May 21, 2019. It is now read-only.

Commit ebc7c29

Browse files
committed
[test] #ifdef new builtin tests for __arm__ platform
Add an #if that excludes the newly added aeabi* tests on non-ARM platforms. This is consistent with other ARM tests, and aims to make running builtin tests easier. Lacking a proper infrastructure to run tests selectively, it is more convenient if we do not have to implement directory-platform exclusions and can just rely on tests compiling to no-op on other platforms. Differential Revision: https://reviews.llvm.org/D29708 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@294438 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 431213c commit ebc7c29

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

test/builtins/Unit/arm/aeabi_idivmod_test.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "int_lib.h"
1515
#include <stdio.h>
1616

17+
#if __arm__
1718
// Based on divmodsi4_test.c
1819

1920
extern du_int __aeabi_idivmod(si_int a, si_int b);
@@ -38,10 +39,12 @@ int test__aeabi_idivmod(si_int a, si_int b,
3839

3940
return 0;
4041
}
42+
#endif
4143

4244

4345
int main()
4446
{
47+
#if __arm__
4548
if (test__aeabi_idivmod(0, 1, 0, 0))
4649
return 1;
4750
if (test__aeabi_idivmod(0, -1, 0, 0))
@@ -69,6 +72,9 @@ int main()
6972
return 1;
7073
if (test__aeabi_idivmod(0x80000007, 8, 0xf0000001, -1))
7174
return 1;
75+
#else
76+
printf("skipped\n");
77+
#endif
7278

7379
return 0;
7480
}

test/builtins/Unit/arm/aeabi_uidivmod_test.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "int_lib.h"
1515
#include <stdio.h>
1616

17+
#if __arm__
1718
// Based on udivmodsi4_test.c
1819

1920
extern du_int __aeabi_uidivmod(su_int a, su_int b);
@@ -38,10 +39,12 @@ int test__aeabi_uidivmod(su_int a, su_int b,
3839

3940
return 0;
4041
}
42+
#endif
4143

4244

4345
int main()
4446
{
47+
#if __arm__
4548
if (test__aeabi_uidivmod(0, 1, 0, 0))
4649
return 1;
4750

@@ -56,6 +59,9 @@ int main()
5659

5760
if (test__aeabi_uidivmod(0x80000003, 8, 0x10000000, 3))
5861
return 1;
62+
#else
63+
printf("skipped\n");
64+
#endif
5965

6066
return 0;
6167
}

test/builtins/Unit/arm/aeabi_uldivmod_test.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "int_lib.h"
1515
#include <stdio.h>
1616

17+
#if __arm__
1718
// Based on udivmoddi4_test.c
1819

1920
COMPILER_RT_ABI void /* __value_in_regs */ __aeabi_uldivmod(du_int a, du_int b);
@@ -20637,14 +20638,19 @@ du_int tests[][4] =
2063720638
{0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000001uLL},
2063820639
{0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}
2063920640
};
20641+
#endif
2064020642

2064120643
int main()
2064220644
{
20645+
#if __arm__
2064320646
const unsigned N = sizeof(tests) / sizeof(tests[0]);
2064420647
unsigned i;
2064520648
for (i = 0; i < N; ++i)
2064620649
if (test_aeabi_uldivmod(tests[i][0], tests[i][1], tests[i][2], tests[i][3]))
2064720650
return 1;
20651+
#else
20652+
printf("skipped\n");
20653+
#endif
2064820654

2064920655
return 0;
2065020656
}

0 commit comments

Comments
 (0)