xref: /llvm-project/llvm/test/tools/llvm-reduce/file-output-type.test (revision 2aafb73f86f4296b1620540e5d7e49d19f18e60b)
1# REQUIRES: default_triple
2# RUN: rm -rf %t.dir && mkdir %t.dir  && cd %t.dir
3
4# RUN: llvm-as -o test-output-format.bc %p/Inputs/test-output-format.ll
5
6# A .ll input file should default to text output in reduced.ll
7# RUN: llvm-reduce --delta-passes=instructions --test FileCheck --test-arg %s --test-arg --input-file %p/Inputs/test-output-format.ll
8# RUN: llvm-as -disable-output reduced.ll
9
10
11# A .bc input file should default to bitcode output, in reduced.bc (with bitcode intermediates)
12# RUN: rm -f reduced.ll reduced.bc
13# RUN: llvm-reduce --delta-passes=instructions --test %python --test-arg %p/Inputs/llvm-dis-and-filecheck.py --test-arg llvm-dis --test-arg FileCheck --test-arg %s test-output-format.bc
14# RUN: llvm-dis -disable-output reduced.bc
15
16
17# A .bc input file with a requested .bc output should produce bitcode
18# RUN: llvm-reduce --delta-passes=instructions -o %t.0.bc --test %python --test-arg %p/Inputs/llvm-dis-and-filecheck.py --test-arg llvm-dis --test-arg FileCheck --test-arg %s test-output-format.bc
19# RUN: llvm-dis -disable-output %t.0.bc
20
21
22# A .bc input file with a requested .ll output
23# RUN: rm -f reduced.ll reduced.bc
24# RUN: llvm-reduce --delta-passes=instructions -o %t.0.ll --test %python --test-arg %p/Inputs/llvm-dis-and-filecheck.py --test-arg llvm-dis --test-arg FileCheck --test-arg %s test-output-format.bc
25# RUN: llvm-dis -disable-output %t.0.ll
26
27
28# A file name ending in .bc
29# RUN: llvm-reduce -o %t.1.bc --delta-passes=instructions --test FileCheck --test-arg %s --test-arg --input-file %p/Inputs/test-output-format.ll
30# RUN: llvm-as -disable-output %t.1.bc
31
32
33# Make sure an explicit -output-bitcode produces bitcode output regardless of suffix
34# RUN: llvm-reduce -output-bitcode -o %t.2_no_suffix --delta-passes=instructions --test FileCheck --test-arg %s --test-arg --input-file %p/Inputs/test-output-format.ll
35# RUN: llvm-dis -disable-output %t.2_no_suffix
36
37
38# Make sure an explicit -output-bitcode overrides .ll suffix
39# RUN: llvm-reduce -output-bitcode -o %t.2.ll --delta-passes=instructions --test FileCheck --test-arg %s --test-arg --input-file %p/Inputs/test-output-format.ll
40# RUN: llvm-dis -disable-output %t.2.ll
41
42
43# Make sure MIR ignores requests for bitcode
44# RUN: llvm-reduce -output-bitcode --delta-passes=instructions -o %t.3 --test FileCheck --test-arg --check-prefix=MIR --test-arg %s --test-arg --input-file %p/Inputs/test-output-format.mir
45# RUN: llc -x mir -run-pass=none -o /dev/null %t.3
46
47
48# CHECK: store i32 0
49# MIR: G_CONSTANT i32 0
50