Expand test for Extract Tuple Instruction

This commit is contained in:
Owen Mansel-Chan
2025-05-13 15:48:29 +01:00
parent c608a9056b
commit b06491125e
2 changed files with 9 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
| test.go:9:2:9:16 | ... := ...[0] | file://:0:0:0:0 | bool |
| test.go:9:2:9:16 | ... := ...[1] | file://:0:0:0:0 | bool |
| test.go:15:2:15:20 | ... := ...[0] | file://:0:0:0:0 | string |
| test.go:15:2:15:20 | ... := ...[1] | file://:0:0:0:0 | bool |
| test.go:21:2:21:22 | ... := ...[0] | file://:0:0:0:0 | string |
| test.go:21:2:21:22 | ... := ...[1] | file://:0:0:0:0 | bool |
| test.go:9:2:9:16 | ... := ...[0] | test.go:9:13:9:16 | <-... | 0 | file://:0:0:0:0 | bool |
| test.go:9:2:9:16 | ... := ...[1] | test.go:9:13:9:16 | <-... | 1 | file://:0:0:0:0 | bool |
| test.go:15:2:15:20 | ... := ...[0] | test.go:15:13:15:20 | index expression | 0 | file://:0:0:0:0 | string |
| test.go:15:2:15:20 | ... := ...[1] | test.go:15:13:15:20 | index expression | 1 | file://:0:0:0:0 | bool |
| test.go:21:2:21:22 | ... := ...[0] | test.go:21:13:21:22 | type assertion | 0 | file://:0:0:0:0 | string |
| test.go:21:2:21:22 | ... := ...[1] | test.go:21:13:21:22 | type assertion | 1 | file://:0:0:0:0 | bool |

View File

@@ -1,4 +1,5 @@
import go
from IR::ExtractTupleElementInstruction extract
select extract, extract.getResultType()
from IR::ExtractTupleElementInstruction extract, IR::Instruction base, int idx, Type resultType
where extract.extractsElement(base, idx) and resultType = extract.getResultType()
select extract, base, idx, resultType