Peter Collingbourne | cb6b920 | 2016-11-29 21:54:33 +0000 | [diff] [blame] | 1 | ; RUN: llvm-as -o %t %s |
| 2 | ; RUN: llvm-modextract -n 0 -o - %t | llvm-dis | FileCheck %s |
| 3 | ; RUN: not llvm-modextract -n 1 -o - %t 2>&1 | FileCheck --check-prefix=ERROR %s |
| 4 | ; RUN: llvm-modextract -b -n 0 -o - %t | llvm-dis | FileCheck %s |
| 5 | ; RUN: not llvm-modextract -b -n 1 -o - %t 2>&1 | FileCheck --check-prefix=ERROR %s |
| 6 | |
Peter Collingbourne | 85c2184a | 2016-12-01 23:13:11 +0000 | [diff] [blame] | 7 | ; RUN: llvm-modextract -n 0 -o %t0 %t |
| 8 | ; RUN: llvm-dis -o - %t0 | FileCheck %s |
| 9 | ; RUN: llvm-modextract -b -n 0 -o %t1 %t |
| 10 | ; RUN: llvm-dis -o - %t1 | FileCheck %s |
| 11 | |
Peter Collingbourne | cb6b920 | 2016-11-29 21:54:33 +0000 | [diff] [blame] | 12 | ; CHECK: define void @f() |
| 13 | ; ERROR: llvm-modextract: error: module index out of range; bitcode file contains 1 module(s) |
| 14 | |
| 15 | define void @f() { |
| 16 | ret void |
| 17 | } |