aboutsummaryrefslogtreecommitdiff
path: root/test/NaCl
diff options
context:
space:
mode:
authorMark Seaborn <mseaborn@chromium.org>2013-06-25 14:10:05 -0700
committerMark Seaborn <mseaborn@chromium.org>2013-06-25 14:10:05 -0700
commit35d0901ac239469021a36f21e488cf20484f2095 (patch)
treee071c53b6a03c913cc7a37ad4df84c49ac733a9e /test/NaCl
parente93df18eccc8d9cad27853b805a5a22b124b416d (diff)
PNaCl wire format: Remove the top-level DATALAYOUT record
PNaCl only supports a fixed data layout, so treat this as implicit in the pexe file. Add the data layout field back at read time, to prevent accidentally using any architecture-specific backend data layout when translating, and to ensure that any IR passes that use the data layout work correctly. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3505 TEST=*.ll tests + PNaCl toolchain trybots Review URL: https://codereview.chromium.org/17591014
Diffstat (limited to 'test/NaCl')
-rw-r--r--test/NaCl/Bitcode/implicit-datalayout.ll9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/NaCl/Bitcode/implicit-datalayout.ll b/test/NaCl/Bitcode/implicit-datalayout.ll
new file mode 100644
index 0000000000..5a957dffec
--- /dev/null
+++ b/test/NaCl/Bitcode/implicit-datalayout.ll
@@ -0,0 +1,9 @@
+; RUN: llvm-as < %s | pnacl-freeze | pnacl-thaw - | llvm-dis - | FileCheck %s
+
+; The "datalayout" field is considered to be implicit in the pexe. It
+; is not stored in the pexe; the reader adds it implicitly.
+;
+; The most important parts of the datalayout for PNaCl are the pointer
+; size and the endianness ("e" for little endian).
+
+; CHECK: target datalayout = "e{{.*}}p:32:32:32{{.*}}"