authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-10-03 01:26:07-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-10-03 01:26:07-04:00
logf86684f4100c1dcc886357b79108df1e8f9e3f2e
treeae7a4da31310f7f025804b9545058822d0adb112
parent8d4668231a9812067d5b12ebabd78871dfb8517a

fix duplicated symbols in compiler-rt tests


2 files changed, 119 insertions(+), 117 deletions(-)

std/special/compiler_rt/aulldiv.zig+59-58
...@@ -1,65 +1,66 @@...@@ -1,65 +1,66 @@
1const builtin = @import("builtin");1const builtin = @import("builtin");
2const linkage = if (builtin.is_test) builtin.GlobalLinkage.Internal else builtin.GlobalLinkage.Strong;
3const is_win32 = builtin.os == builtin.Os.windows and builtin.arch == builtin.Arch.i386;
24
3export nakedcc fn _aulldiv() {5export nakedcc fn _aulldiv() {
4 @setDebugSafety(this, false);6 if (is_win32) {
57 @setDebugSafety(this, false);
6 if (comptime builtin.os == builtin.Os.windows) {8 @setGlobalLinkage(_aulldiv, linkage);
7 if (comptime builtin.arch == builtin.Arch.i386) {9 asm volatile (
8 asm volatile (10 \\.intel_syntax noprefix
9 \\.intel_syntax noprefix11 \\
10 \\12 \\ push ebx
11 \\ push ebx13 \\ push esi
12 \\ push esi14 \\ mov eax,dword ptr [esp+18h]
13 \\ mov eax,dword ptr [esp+18h]15 \\ or eax,eax
14 \\ or eax,eax16 \\ jne L1
15 \\ jne L117 \\ mov ecx,dword ptr [esp+14h]
16 \\ mov ecx,dword ptr [esp+14h]18 \\ mov eax,dword ptr [esp+10h]
17 \\ mov eax,dword ptr [esp+10h]19 \\ xor edx,edx
18 \\ xor edx,edx20 \\ div ecx
19 \\ div ecx21 \\ mov ebx,eax
20 \\ mov ebx,eax22 \\ mov eax,dword ptr [esp+0Ch]
21 \\ mov eax,dword ptr [esp+0Ch]23 \\ div ecx
22 \\ div ecx24 \\ mov edx,ebx
23 \\ mov edx,ebx25 \\ jmp L2
24 \\ jmp L226 \\ L1:
25 \\ L1:27 \\ mov ecx,eax
26 \\ mov ecx,eax28 \\ mov ebx,dword ptr [esp+14h]
27 \\ mov ebx,dword ptr [esp+14h]29 \\ mov edx,dword ptr [esp+10h]
28 \\ mov edx,dword ptr [esp+10h]30 \\ mov eax,dword ptr [esp+0Ch]
29 \\ mov eax,dword ptr [esp+0Ch]31 \\ L3:
30 \\ L3:32 \\ shr ecx,1
31 \\ shr ecx,133 \\ rcr ebx,1
32 \\ rcr ebx,134 \\ shr edx,1
33 \\ shr edx,135 \\ rcr eax,1
34 \\ rcr eax,136 \\ or ecx,ecx
35 \\ or ecx,ecx37 \\ jne L3
36 \\ jne L338 \\ div ebx
37 \\ div ebx39 \\ mov esi,eax
38 \\ mov esi,eax40 \\ mul dword ptr [esp+18h]
39 \\ mul dword ptr [esp+18h]41 \\ mov ecx,eax
40 \\ mov ecx,eax42 \\ mov eax,dword ptr [esp+14h]
41 \\ mov eax,dword ptr [esp+14h]43 \\ mul esi
42 \\ mul esi44 \\ add edx,ecx
43 \\ add edx,ecx45 \\ jb L4
44 \\ jb L446 \\ cmp edx,dword ptr [esp+10h]
45 \\ cmp edx,dword ptr [esp+10h]47 \\ ja L4
46 \\ ja L448 \\ jb L5
47 \\ jb L549 \\ cmp eax,dword ptr [esp+0Ch]
48 \\ cmp eax,dword ptr [esp+0Ch]50 \\ jbe L5
49 \\ jbe L551 \\ L4:
50 \\ L4:52 \\ dec esi
51 \\ dec esi53 \\ L5:
52 \\ L5:54 \\ xor edx,edx
53 \\ xor edx,edx55 \\ mov eax,esi
54 \\ mov eax,esi56 \\ L2:
55 \\ L2:57 \\ pop esi
56 \\ pop esi58 \\ pop ebx
57 \\ pop ebx59 \\ ret 10h
58 \\ ret 10h60 );
59 );61 unreachable;
60 unreachable;
61 }
62 }62 }
6363
64 @setGlobalLinkage(_aulldiv, builtin.GlobalLinkage.Internal);64 @setGlobalLinkage(_aulldiv, builtin.GlobalLinkage.Internal);
65 unreachable;
65}66}
std/special/compiler_rt/aullrem.zig+60-59
...@@ -1,66 +1,67 @@...@@ -1,66 +1,67 @@
1const builtin = @import("builtin");1const builtin = @import("builtin");
2const linkage = if (builtin.is_test) builtin.GlobalLinkage.Internal else builtin.GlobalLinkage.Strong;
3const is_win32 = builtin.os == builtin.Os.windows and builtin.arch == builtin.Arch.i386;
24
3export nakedcc fn _aullrem() {5export nakedcc fn _aullrem() {
4 @setDebugSafety(this, false);6 if (is_win32) {
57 @setDebugSafety(this, false);
6 if (comptime builtin.os == builtin.Os.windows) {8 @setGlobalLinkage(_aullrem, linkage);
7 if (comptime builtin.arch == builtin.Arch.i386) {9 asm volatile (
8 asm volatile (10 \\.intel_syntax noprefix
9 \\.intel_syntax noprefix11 \\
10 \\12 \\ push ebx
11 \\ push ebx13 \\ mov eax,dword ptr [esp+14h]
12 \\ mov eax,dword ptr [esp+14h]14 \\ or eax,eax
13 \\ or eax,eax15 \\ jne L1a
14 \\ jne L1a16 \\ mov ecx,dword ptr [esp+10h]
15 \\ mov ecx,dword ptr [esp+10h]17 \\ mov eax,dword ptr [esp+0Ch]
16 \\ mov eax,dword ptr [esp+0Ch]18 \\ xor edx,edx
17 \\ xor edx,edx19 \\ div ecx
18 \\ div ecx20 \\ mov eax,dword ptr [esp+8]
19 \\ mov eax,dword ptr [esp+8]21 \\ div ecx
20 \\ div ecx22 \\ mov eax,edx
21 \\ mov eax,edx23 \\ xor edx,edx
22 \\ xor edx,edx24 \\ jmp L2a
23 \\ jmp L2a25 \\ L1a:
24 \\ L1a:26 \\ mov ecx,eax
25 \\ mov ecx,eax27 \\ mov ebx,dword ptr [esp+10h]
26 \\ mov ebx,dword ptr [esp+10h]28 \\ mov edx,dword ptr [esp+0Ch]
27 \\ mov edx,dword ptr [esp+0Ch]29 \\ mov eax,dword ptr [esp+8]
28 \\ mov eax,dword ptr [esp+8]30 \\ L3a:
29 \\ L3a:31 \\ shr ecx,1
30 \\ shr ecx,132 \\ rcr ebx,1
31 \\ rcr ebx,133 \\ shr edx,1
32 \\ shr edx,134 \\ rcr eax,1
33 \\ rcr eax,135 \\ or ecx,ecx
34 \\ or ecx,ecx36 \\ jne L3a
35 \\ jne L3a37 \\ div ebx
36 \\ div ebx38 \\ mov ecx,eax
37 \\ mov ecx,eax39 \\ mul dword ptr [esp+14h]
38 \\ mul dword ptr [esp+14h]40 \\ xchg eax,ecx
39 \\ xchg eax,ecx41 \\ mul dword ptr [esp+10h]
40 \\ mul dword ptr [esp+10h]42 \\ add edx,ecx
41 \\ add edx,ecx43 \\ jb L4a
42 \\ jb L4a44 \\ cmp edx,dword ptr [esp+0Ch]
43 \\ cmp edx,dword ptr [esp+0Ch]45 \\ ja L4a
44 \\ ja L4a46 \\ jb L5a
45 \\ jb L5a47 \\ cmp eax,dword ptr [esp+8]
46 \\ cmp eax,dword ptr [esp+8]48 \\ jbe L5a
47 \\ jbe L5a49 \\ L4a:
48 \\ L4a:50 \\ sub eax,dword ptr [esp+10h]
49 \\ sub eax,dword ptr [esp+10h]51 \\ sbb edx,dword ptr [esp+14h]
50 \\ sbb edx,dword ptr [esp+14h]52 \\ L5a:
51 \\ L5a:53 \\ sub eax,dword ptr [esp+8]
52 \\ sub eax,dword ptr [esp+8]54 \\ sbb edx,dword ptr [esp+0Ch]
53 \\ sbb edx,dword ptr [esp+0Ch]55 \\ neg edx
54 \\ neg edx56 \\ neg eax
55 \\ neg eax57 \\ sbb edx,0
56 \\ sbb edx,058 \\ L2a:
57 \\ L2a:59 \\ pop ebx
58 \\ pop ebx60 \\ ret 10h
59 \\ ret 10h61 );
60 );62 unreachable;
61 unreachable;
62 }
63 }63 }
6464
65 @setGlobalLinkage(_aullrem, builtin.GlobalLinkage.Internal);65 @setGlobalLinkage(_aullrem, builtin.GlobalLinkage.Internal);
66 unreachable;
66}67}