diff options
| author | Nozomi Hijikata <121233810+nozomemein@users.noreply.github.com> | 2026-02-10 07:34:59 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-09 14:34:59 -0800 |
| commit | e0b757f63aa6e720af6200171b2f0841d4efe7ed (patch) | |
| tree | 7ef6839604aee313e55dd0eb1760786ce78304f4 /test | |
| parent | 9efe557da5e17fc860f40956192e9df2e6bd1e6c (diff) | |
ZJIT: Compile getconstant insn (#16109)
* ZJIT: Compile getconstant insn
* ZJIT: add fixme comments for opt_getconstant_path
* ZJIT: Address comments
- Replace fixme with actionable todo comment
- Fix type validation for GetConstant
Diffstat (limited to 'test')
| -rw-r--r-- | test/ruby/test_zjit.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_zjit.rb b/test/ruby/test_zjit.rb index 7b068e9898..095b690c7b 100644 --- a/test/ruby/test_zjit.rb +++ b/test/ruby/test_zjit.rb @@ -3380,6 +3380,21 @@ class TestZJIT < Test::Unit::TestCase }, call_threshold: 1, insns: [:opt_getconstant_path] end + def test_getconstant + assert_compiles '1', %q{ + class Foo + CONST = 1 + end + + def test(klass) + klass::CONST + end + + test(Foo) + test(Foo) + }, call_threshold: 2, insns: [:getconstant] + end + def test_expandarray_no_splat assert_compiles '[3, 4]', %q{ def test(o) |
