-
-
Notifications
You must be signed in to change notification settings - Fork 594
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 #10009 from ibuclaw/dmd-cxx-19856
[dmd-cxx] Fix Issue 19856 - [aApplycd2]: foreach (int) doesn't work on BigEndian targets
- Loading branch information
Showing
5 changed files
with
160 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* REQUIRED_ARGS: -m64 | ||
TEST_OUTPUT: | ||
--- | ||
compilable/b16976.d(33): Deprecation: foreach: loop index implicitly converted from `size_t` to `int` | ||
compilable/b16976.d(34): Deprecation: foreach: loop index implicitly converted from `size_t` to `int` | ||
compilable/b16976.d(35): Deprecation: foreach: loop index implicitly converted from `size_t` to `char` | ||
compilable/b16976.d(36): Deprecation: foreach: loop index implicitly converted from `size_t` to `char` | ||
compilable/b16976.d(41): Deprecation: foreach: loop index implicitly converted from `size_t` to `int` | ||
compilable/b16976.d(42): Deprecation: foreach: loop index implicitly converted from `size_t` to `int` | ||
compilable/b16976.d(43): Deprecation: foreach: loop index implicitly converted from `size_t` to `char` | ||
compilable/b16976.d(44): Deprecation: foreach: loop index implicitly converted from `size_t` to `char` | ||
compilable/b16976.d(50): Deprecation: foreach: loop index implicitly converted from `size_t` to `int` | ||
compilable/b16976.d(51): Deprecation: foreach: loop index implicitly converted from `size_t` to `int` | ||
compilable/b16976.d(52): Deprecation: foreach: loop index implicitly converted from `size_t` to `char` | ||
compilable/b16976.d(53): Deprecation: foreach: loop index implicitly converted from `size_t` to `char` | ||
compilable/b16976.d(58): Deprecation: foreach: loop index implicitly converted from `size_t` to `int` | ||
compilable/b16976.d(59): Deprecation: foreach: loop index implicitly converted from `size_t` to `int` | ||
compilable/b16976.d(60): Deprecation: foreach: loop index implicitly converted from `size_t` to `char` | ||
compilable/b16976.d(61): Deprecation: foreach: loop index implicitly converted from `size_t` to `char` | ||
compilable/b16976.d(62): Deprecation: foreach: loop index implicitly converted from `size_t` to `int` | ||
compilable/b16976.d(63): Deprecation: foreach: loop index implicitly converted from `size_t` to `int` | ||
compilable/b16976.d(64): Deprecation: foreach: loop index implicitly converted from `size_t` to `char` | ||
compilable/b16976.d(65): Deprecation: foreach: loop index implicitly converted from `size_t` to `char` | ||
--- | ||
*/ | ||
void main() | ||
{ | ||
int[] dyn = [1,2,3,4,5]; | ||
int[5] sta = [1,2,3,4,5]; | ||
char[] str = ['1','2','3','4','5']; | ||
char[5] chr = ['1','2','3','4','5']; | ||
|
||
foreach(int i, v; dyn) { } | ||
foreach_reverse(int i, v; dyn) { } | ||
foreach(char i, v; dyn) { } | ||
foreach_reverse(char i, v; dyn) { } | ||
foreach(int i, v; sta) { } | ||
foreach_reverse(int i, v; sta) { } | ||
foreach(char i, v; sta) { } | ||
foreach_reverse(char i, v; sta) { } | ||
foreach(int i, v; str) { } | ||
foreach_reverse(int i, v; str) { } | ||
foreach(char i, v; str) { } | ||
foreach_reverse(char i, v; str) { } | ||
foreach(int i, v; chr) { } | ||
foreach_reverse(int i, v; chr) { } | ||
foreach(char i, v; chr) { } | ||
foreach_reverse(char i, v; chr) { } | ||
|
||
foreach(int i, dchar v; dyn) { } | ||
foreach_reverse(int i, dchar v; dyn) { } | ||
foreach(char i, dchar v; dyn) { } | ||
foreach_reverse(char i, dchar v; dyn) { } | ||
foreach(int i, dchar v; sta) { } | ||
foreach_reverse(int i, dchar v; sta) { } | ||
foreach(char i, dchar v; sta) { } | ||
foreach_reverse(char i, dchar v; sta) { } | ||
foreach(int i, dchar v; str) { } | ||
foreach_reverse(int i, dchar v; str) { } | ||
foreach(char i, dchar v; str) { } | ||
foreach_reverse(char i, dchar v; str) { } | ||
foreach(int i, dchar v; chr) { } | ||
foreach_reverse(int i, dchar v; chr) { } | ||
foreach(char i, dchar v; chr) { } | ||
foreach_reverse(char i, dchar v; chr) { } | ||
} |
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,44 @@ | ||
/* TEST_OUTPUT: | ||
--- | ||
fail_compilation/diag16976.d(28): Error: foreach: key cannot be of non-integral type `float` | ||
fail_compilation/diag16976.d(29): Error: foreach: key cannot be of non-integral type `float` | ||
fail_compilation/diag16976.d(30): Error: foreach: key cannot be of non-integral type `float` | ||
fail_compilation/diag16976.d(31): Error: foreach: key cannot be of non-integral type `float` | ||
fail_compilation/diag16976.d(32): Error: foreach: key cannot be of non-integral type `float` | ||
fail_compilation/diag16976.d(33): Error: foreach: key cannot be of non-integral type `float` | ||
fail_compilation/diag16976.d(34): Error: foreach: key cannot be of non-integral type `float` | ||
fail_compilation/diag16976.d(35): Error: foreach: key cannot be of non-integral type `float` | ||
fail_compilation/diag16976.d(36): Error: foreach: key cannot be of non-integral type `float` | ||
fail_compilation/diag16976.d(37): Error: foreach: key cannot be of non-integral type `float` | ||
fail_compilation/diag16976.d(38): Error: foreach: key cannot be of non-integral type `float` | ||
fail_compilation/diag16976.d(39): Error: foreach: key cannot be of non-integral type `float` | ||
fail_compilation/diag16976.d(40): Error: foreach: key cannot be of non-integral type `float` | ||
fail_compilation/diag16976.d(41): Error: foreach: key cannot be of non-integral type `float` | ||
fail_compilation/diag16976.d(42): Error: foreach: key cannot be of non-integral type `float` | ||
fail_compilation/diag16976.d(43): Error: foreach: key cannot be of non-integral type `float` | ||
--- | ||
*/ | ||
|
||
void main() | ||
{ | ||
int[] dyn = [1,2,3,4,5]; | ||
int[5] sta = [1,2,3,4,5]; | ||
char[] str = ['1','2','3','4','5']; | ||
char[5] chr = ['1','2','3','4','5']; | ||
foreach(float f, i; dyn) {} | ||
foreach(float f, i; sta) {} | ||
foreach(float f, i; str) {} | ||
foreach(float f, i; chr) {} | ||
foreach(float f, dchar i; dyn) {} | ||
foreach(float f, dchar i; sta) {} | ||
foreach(float f, dchar i; str) {} | ||
foreach(float f, dchar i; chr) {} | ||
foreach_reverse(float f, i; dyn) {} | ||
foreach_reverse(float f, i; sta) {} | ||
foreach_reverse(float f, i; str) {} | ||
foreach_reverse(float f, i; chr) {} | ||
foreach_reverse(float f, dchar i; dyn) {} | ||
foreach_reverse(float f, dchar i; sta) {} | ||
foreach_reverse(float f, dchar i; str) {} | ||
foreach_reverse(float f, dchar i; chr) {} | ||
} |
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