This specifies the alignment for an integer type of a given bit
``<size>``. The value of ``<size>`` must be in the range [1,2^23).
``<pref>`` is optional and defaults to ``<abi>``.
+ For ``i8``, the ``<abi>`` value must equal 8,
+ that is, ``i8`` must be naturally aligned.
``v<size>:<abi>[:<pref>]``
This specifies the alignment for a vector type of a given bit
``<size>``. The value of ``<size>`` must be in the range [1,2^23).
same as the default address space.
- ``S0`` - natural stack alignment is unspecified
- ``i1:8:8`` - i1 is 8-bit (byte) aligned
-- ``i8:8:8`` - i8 is 8-bit (byte) aligned
+- ``i8:8:8`` - i8 is 8-bit (byte) aligned as mandated
- ``i16:16:16`` - i16 is 16-bit aligned
- ``i32:32:32`` - i32 is 32-bit aligned
- ``i64:32:64`` - i64 has ABI alignment of 32-bits but preferred
return reportError("Invalid ABI alignment, must be a 16bit integer");
if (ABIAlign != 0 && !isPowerOf2_64(ABIAlign))
return reportError("Invalid ABI alignment, must be a power of 2");
+ if (AlignType == INTEGER_ALIGN && Size == 8 && ABIAlign != 1)
+ return reportError(
+ "Invalid ABI alignment, i8 must be naturally aligned");
// Preferred alignment.
unsigned PrefAlign = ABIAlign;
--- /dev/null
+; RUN: not llvm-as %s 2>&1 | FileCheck %s
+
+; CHECK: error: Invalid ABI alignment, i8 must be naturally aligned
+
+target datalayout = "i8:16"