1# RUN: not --crash llc -march=aarch64 -o /dev/null -run-pass=none -verify-machineinstrs %s 2>&1 | FileCheck %s
2# REQUIRES: aarch64-registered-target
3
4---
5name:            test_extract
6legalized:       true
7regBankSelected: false
8selected:        false
9tracksRegLiveness: true
10liveins:
11body:             |
12  bb.0:
13
14    ; CHECK: Bad machine code: Too few operands
15    %0:_(s32) = G_EXTRACT
16
17    ; CHECK: Bad machine code: Too few operands
18    %1:_(s32) = G_EXTRACT 0
19
20    ; CHECK: Bad machine code: extract source must be a register
21    %2:_(s32) = G_EXTRACT 0, 1
22
23    ; CHECK: Bad machine code: extract offset must be a constant
24    %3:_(s32) = G_IMPLICIT_DEF
25    %4:_(s32) = G_CONSTANT i32 0
26    %5:_(s16) = G_EXTRACT %3, %4
27
28    ; CHECK: Bad machine code: extract source must be larger than result
29    %6:_(s32) = G_IMPLICIT_DEF
30    %7:_(s32) = G_EXTRACT %6, 0
31
32    ; CHECK: Bad machine code: extract reads past end of register
33    %8:_(s1) = G_EXTRACT %6, 32
34
35...
36