xref: /aosp_15_r20/external/llvm/test/Verifier/SelfReferential.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker; CHECK: Only PHI nodes may reference their own value
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker; Test that self referential instructions are not allowed
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Workerdefine void @test() {
7*9880d681SAndroid Build Coastguard Worker	%A = add i32 %A, 0		; <i32> [#uses=1]
8*9880d681SAndroid Build Coastguard Worker	ret void
9*9880d681SAndroid Build Coastguard Worker}
10*9880d681SAndroid Build Coastguard Worker
11