summaryrefslogtreecommitdiffstats
path: root/llvm/test/Bitcode
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
commit5d303285b9825a44f233102766be39bd1cff4de9 (patch)
treedcb1588e4f535601df4698dff21a6e80f60a8eaf /llvm/test/Bitcode
parentd1aad265891cf58b4c16c532d3578c4bbbb297ff (diff)
downloadbcm5719-llvm-5d303285b9825a44f233102766be39bd1cff4de9.tar.gz
bcm5719-llvm-5d303285b9825a44f233102766be39bd1cff4de9.zip
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> llvm-svn: 251325
Diffstat (limited to 'llvm/test/Bitcode')
-rw-r--r--llvm/test/Bitcode/identification.ll6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/test/Bitcode/identification.ll b/llvm/test/Bitcode/identification.ll
new file mode 100644
index 00000000000..2f09d5a4328
--- /dev/null
+++ b/llvm/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
OpenPOWER on IntegriCloud