From 10e41102333d9ec2f30f4b5bbdf1fc859397fd90 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Tue, 29 Nov 2016 21:55:09 +0000 Subject: [PATCH] Bitcode: Add a more comprehensive multi-module test now that we have both llvm-cat and llvm-modextract. Differential Revision: https://reviews.llvm.org/D27189 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288202 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Bitcode/multi-module.ll | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/test/Bitcode/multi-module.ll b/test/Bitcode/multi-module.ll index a6c25c7cdbe..5f73240e8a0 100644 --- a/test/Bitcode/multi-module.ll +++ b/test/Bitcode/multi-module.ll @@ -2,10 +2,11 @@ ; RUN: not llvm-dis -o - %t 2>&1 | FileCheck --check-prefix=ERROR %s ; ERROR: Expected a single module -; FIXME: Introduce a tool for extracting modules from bitcode and use it here. -; For now we can at least check that the bitcode contains multiple modules. ; RUN: llvm-bcanalyzer -dump %t | FileCheck --check-prefix=BCA %s +; RUN: llvm-modextract -n 0 -o - %t | llvm-dis | FileCheck --check-prefix=IR1 %s +; RUN: llvm-modextract -n 1 -o - %t | llvm-dis | FileCheck --check-prefix=IR2 %s + ; RUN: llvm-as -o %t1 %s ; RUN: llvm-as -o %t2 %S/Inputs/multi-module.ll ; RUN: llvm-cat -o %t %t1 %t2 @@ -16,10 +17,18 @@ ; RUN: not llvm-dis -o - %t 2>&1 | FileCheck --check-prefix=ERROR %s ; RUN: llvm-bcanalyzer -dump %t | FileCheck --check-prefix=BCA %s +; RUN: llvm-modextract -n 0 -o - %t | llvm-dis | FileCheck --check-prefix=IR1 %s +; RUN: llvm-modextract -n 1 -o - %t | llvm-dis | FileCheck --check-prefix=IR2 %s + ; RUN: llvm-cat -b -o %t3 %t %t ; RUN: not llvm-dis -o - %t3 2>&1 | FileCheck --check-prefix=ERROR %s ; RUN: llvm-bcanalyzer -dump %t3 | FileCheck --check-prefix=BCA4 %s +; RUN: llvm-modextract -n 0 -o - %t3 | llvm-dis | FileCheck --check-prefix=IR1 %s +; RUN: llvm-modextract -n 1 -o - %t3 | llvm-dis | FileCheck --check-prefix=IR2 %s +; RUN: llvm-modextract -n 2 -o - %t3 | llvm-dis | FileCheck --check-prefix=IR1 %s +; RUN: llvm-modextract -n 3 -o - %t3 | llvm-dis | FileCheck --check-prefix=IR2 %s + ; BCA: