aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/tools/llvm-ir2vec/error-handling.ll
blob: 8e9e45513434c61b1781111035490a029678f984 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
; Test error handling and input validation for llvm-ir2vec tool

; RUN: not llvm-ir2vec embeddings %s 2>&1 | FileCheck %s -check-prefix=CHECK-NO-VOCAB
; RUN: not llvm-ir2vec embeddings --function=nonexistent --ir2vec-vocab-path=%ir2vec_test_vocab_dir/dummy_3D_nonzero_opc_vocab.json %s 2>&1 | FileCheck %s -check-prefix=CHECK-FUNC-NOT-FOUND

; Simple test function for valid IR
define i32 @test_func(i32 %a) {
entry:
  ret i32 %a
}

; CHECK-NO-VOCAB: error: IR2Vec vocabulary file path not specified; You may need to set it using --ir2vec-vocab-path
; CHECK-FUNC-NOT-FOUND: error: Function 'nonexistent' not found