-
-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3808 from JohanEngelen/gh3802
Fix issue #3802 - Fix size_t size for 32bit ABI on 64bit architectures.
- Loading branch information
Showing
5 changed files
with
52 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Tests compilation for 64-bit architecture with 32-bit word size ABI. | ||
// Triple examples: mips64el-linux-gnuabin32, x86_64-linux-gnux32 | ||
// Targeting x86 because that's the most widely available target in our CI/developer systems. | ||
|
||
// REQUIRES: target_X86 | ||
// RUN: %ldc -mtriple=x86_64-linux-gnux32 -O -c %s | ||
|
||
static assert((void*).sizeof == 4); | ||
static assert(size_t.sizeof == 4); | ||
static assert(ptrdiff_t.sizeof == 4); | ||
|
||
version (D_LP64) static assert(0); | ||
version (D_X32) { /* expected */ } else static assert(0); | ||
|
||
bool equals(string lhs, string rhs) | ||
{ | ||
foreach (const i; 0 .. lhs.length) {} | ||
return false; | ||
} | ||
|
||
// test _d_array_slice_copy optimization IR pass (requires -O) | ||
auto test_ArraySliceCopyOpt() | ||
{ | ||
static void copy(int[] a, int[] b) | ||
{ | ||
a[] = b[]; | ||
} | ||
|
||
int[2] a = [1, 2]; | ||
int[2] b = [3, 4]; | ||
copy(a, b); | ||
return a; | ||
} |