-
-
Notifications
You must be signed in to change notification settings - Fork 664
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[hlc] prefetch should not access field but only addr (#12000)
* [hlc] prefetch should not access field but only addr * [tests] add compilation test
- Loading branch information
Showing
2 changed files
with
29 additions
and
1 deletion.
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,28 @@ | ||
package unit.issues; | ||
|
||
private class Foo { | ||
public var m : Map<Int, String>; | ||
public var length : Int; | ||
public function new() { | ||
} | ||
} | ||
|
||
class Issue12000 extends unit.Test { | ||
var obj = new Foo(); | ||
|
||
#if hl | ||
public function test() { | ||
untyped $prefetch(obj, 0); | ||
untyped $prefetch(obj, 1); | ||
untyped $prefetch(obj, 2); | ||
untyped $prefetch(obj, 3); | ||
untyped $prefetch(obj, 4); | ||
untyped $prefetch(obj.length, 0); | ||
untyped $prefetch(obj.length, 1); | ||
untyped $prefetch(obj.length, 2); | ||
untyped $prefetch(obj.length, 3); | ||
untyped $prefetch(obj.length, 4); | ||
noAssert(); | ||
} | ||
#end | ||
} |