report_fatal_error("Invalid ABI alignment, must be a 16bit integer");
if (!isUInt<16>(pref_align))
report_fatal_error("Invalid preferred alignment, must be a 16bit integer");
+ if (abi_align != 0 && !isPowerOf2_64(abi_align))
+ report_fatal_error("Invalid ABI alignment, must be a power of 2");
+ if (pref_align != 0 && !isPowerOf2_64(pref_align))
+ report_fatal_error("Invalid preferred alignment, must be a power of 2");
if (pref_align < abi_align)
report_fatal_error(
--- /dev/null
+; RUN: not llvm-as < %s 2>&1 | FileCheck %s
+
+target datalayout = "i32:24:32"
+
+; CHECK: Invalid ABI alignment, must be a power of 2
+
--- /dev/null
+; RUN: not llvm-as < %s 2>&1 | FileCheck %s
+
+target datalayout = "i32:32:24"
+
+; CHECK: Invalid preferred alignment, must be a power of 2
+