summaryrefslogtreecommitdiff
path: root/test/Bitcode/identification.ll
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2015-10-26 18:37:00 +0000
committerMehdi Amini <mehdi.amini@apple.com>2015-10-26 18:37:00 +0000
commitb738d340fa9958dbefe8d23a4d4659c2255b823a (patch)
tree05428740a6c4b0424c7569ce80fbdc96e6290d71 /test/Bitcode/identification.ll
parent324bf0ddcc8acfaba6c07415335a978ba3f0a57f (diff)
Add an (optional) identification block in the bitcode
Processing bitcode from a different LLVM version can lead to unexpected behavior. The LLVM project guarantees autoupdating bitcode from a previous minor revision for the same major, but can't make any promise when reading bitcode generated from a either a non-released LLVM, a vendor toolchain, or a "future" LLVM release. This patch aims at being more user-friendly and allows a bitcode produce to emit an optional block at the beginning of the bitcode that will contains an opaque string intended to describe the bitcode producer information. The bitcode reader will dump this information alongside any error it reports. The optional block also includes an "epoch" number, monotonically increasing when incompatible changes are made to the bitcode. The reader will reject bitcode whose epoch is different from the one expected. Differential Revision: http://reviews.llvm.org/D13666 From: Mehdi Amini <mehdi.amini@apple.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251325 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Bitcode/identification.ll')
-rw-r--r--test/Bitcode/identification.ll6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/Bitcode/identification.ll b/test/Bitcode/identification.ll
new file mode 100644
index 00000000000..2f09d5a4328
--- /dev/null
+++ b/test/Bitcode/identification.ll
@@ -0,0 +1,6 @@
+; Check that a block "IDENTIFICATION_BLOCK_ID" is emitted.
+;RUN: llvm-as < %s | llvm-bcanalyzer -dump | FileCheck %s
+;CHECK: <IDENTIFICATION_BLOCK_ID
+;CHECK-NEXT: <STRING
+;CHECK-NEXT: <EPOCH
+;CHECK-NEXT: </IDENTIFICATION_BLOCK_ID