xref: /aosp_15_r20/external/llvm/test/Assembler/getelementptr_struct.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: not llvm-as < %s >/dev/null 2> %t
2*9880d681SAndroid Build Coastguard Worker; RUN: FileCheck %s < %t
3*9880d681SAndroid Build Coastguard Worker; Test the case of a incorrect indices type into struct
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker; CHECK: invalid getelementptr indices
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Worker%RT = type { i8 , [10 x [20 x i32]], i8  }
8*9880d681SAndroid Build Coastguard Worker%ST = type { i32, double, %RT }
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Workerdefine i32* @foo(%ST* %s) {
11*9880d681SAndroid Build Coastguard Workerentry:
12*9880d681SAndroid Build Coastguard Worker  %reg = getelementptr %ST, %ST* %s, i32 1, i64 2, i32 1, i32 5, i32 13
13*9880d681SAndroid Build Coastguard Worker  ret i32* %reg
14*9880d681SAndroid Build Coastguard Worker}
15*9880d681SAndroid Build Coastguard Worker
16