translate-c: Explicitly cast decayed array to pointer with @ptrCast
This enables translation of code that uses pointer arithmetic with arrays
This commit is contained in:
committed by
Veikka Tuominen
parent
5d215cc76b
commit
d01bb21173
@@ -1164,6 +1164,10 @@ pub fn addCases(cases: *tests.RunTranslatedCContext) void {
|
||||
\\ y = (x -= idx);
|
||||
\\ if (y != x || y != &array[5]) abort();
|
||||
\\
|
||||
\\ if (array + idx != &array[1] || array + 1 != &array[1]) abort();
|
||||
\\ idx = -1;
|
||||
\\ if (array - idx != &array[1]) abort();
|
||||
\\
|
||||
\\ return 0;
|
||||
\\}
|
||||
, "");
|
||||
|
||||
Reference in New Issue
Block a user