[llvm] [UnitTests] Convert some data layout parsing tests to GTest (PR #104346)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 14 16:53:04 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-ir
Author: Sergei Barannikov (s-barannikov)
<details>
<summary>Changes</summary>
For now, the testcases are grouped in a single TEST. I'll sort them out and add more testcases in follow-up commits.
---
Full diff: https://github.com/llvm/llvm-project/pull/104346.diff
32 Files Affected:
- (removed) llvm/test/Assembler/datalayout-invalid-function-ptr-alignment.ll (-5)
- (removed) llvm/test/Assembler/datalayout-invalid-i8-alignment.ll (-5)
- (removed) llvm/test/Assembler/datalayout-invalid-stack-natural-alignment.ll (-5)
- (removed) llvm/test/Assembler/invalid-datalayout-alloca-addrspace.ll (-4)
- (removed) llvm/test/Assembler/invalid-datalayout-globals-addrspace.ll (-4)
- (removed) llvm/test/Assembler/invalid-datalayout-index-size.ll (-3)
- (removed) llvm/test/Assembler/invalid-datalayout-program-addrspace.ll (-4)
- (removed) llvm/test/Assembler/invalid-datalayout1.ll (-3)
- (removed) llvm/test/Assembler/invalid-datalayout10.ll (-3)
- (removed) llvm/test/Assembler/invalid-datalayout11.ll (-3)
- (removed) llvm/test/Assembler/invalid-datalayout12.ll (-3)
- (removed) llvm/test/Assembler/invalid-datalayout13.ll (-3)
- (removed) llvm/test/Assembler/invalid-datalayout14.ll (-3)
- (removed) llvm/test/Assembler/invalid-datalayout15.ll (-3)
- (removed) llvm/test/Assembler/invalid-datalayout16.ll (-3)
- (removed) llvm/test/Assembler/invalid-datalayout17.ll (-3)
- (removed) llvm/test/Assembler/invalid-datalayout18.ll (-3)
- (removed) llvm/test/Assembler/invalid-datalayout19.ll (-6)
- (removed) llvm/test/Assembler/invalid-datalayout2.ll (-3)
- (removed) llvm/test/Assembler/invalid-datalayout20.ll (-6)
- (removed) llvm/test/Assembler/invalid-datalayout21.ll (-6)
- (removed) llvm/test/Assembler/invalid-datalayout22.ll (-6)
- (removed) llvm/test/Assembler/invalid-datalayout23.ll (-6)
- (removed) llvm/test/Assembler/invalid-datalayout24.ll (-6)
- (removed) llvm/test/Assembler/invalid-datalayout3.ll (-3)
- (removed) llvm/test/Assembler/invalid-datalayout4.ll (-3)
- (removed) llvm/test/Assembler/invalid-datalayout5.ll (-3)
- (removed) llvm/test/Assembler/invalid-datalayout6.ll (-3)
- (removed) llvm/test/Assembler/invalid-datalayout7.ll (-3)
- (removed) llvm/test/Assembler/invalid-datalayout8.ll (-3)
- (removed) llvm/test/Assembler/invalid-datalayout9.ll (-3)
- (modified) llvm/unittests/IR/DataLayoutTest.cpp (+105)
``````````diff
diff --git a/llvm/test/Assembler/datalayout-invalid-function-ptr-alignment.ll b/llvm/test/Assembler/datalayout-invalid-function-ptr-alignment.ll
deleted file mode 100644
index 7c1e070c292d18..00000000000000
--- a/llvm/test/Assembler/datalayout-invalid-function-ptr-alignment.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: not llvm-as %s 2>&1 | FileCheck %s
-
-; CHECK: error: Alignment is neither 0 nor a power of 2
-
-target datalayout = "Fi24"
diff --git a/llvm/test/Assembler/datalayout-invalid-i8-alignment.ll b/llvm/test/Assembler/datalayout-invalid-i8-alignment.ll
deleted file mode 100644
index e12cfce0309746..00000000000000
--- a/llvm/test/Assembler/datalayout-invalid-i8-alignment.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: not llvm-as %s 2>&1 | FileCheck %s
-
-; CHECK: error: Invalid ABI alignment, i8 must be naturally aligned
-
-target datalayout = "i8:16"
diff --git a/llvm/test/Assembler/datalayout-invalid-stack-natural-alignment.ll b/llvm/test/Assembler/datalayout-invalid-stack-natural-alignment.ll
deleted file mode 100644
index 1ccfb7832a50cc..00000000000000
--- a/llvm/test/Assembler/datalayout-invalid-stack-natural-alignment.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: not llvm-as %s 2>&1 | FileCheck %s
-
-; CHECK: error: Alignment is neither 0 nor a power of 2
-
-target datalayout = "S24"
diff --git a/llvm/test/Assembler/invalid-datalayout-alloca-addrspace.ll b/llvm/test/Assembler/invalid-datalayout-alloca-addrspace.ll
deleted file mode 100644
index f0407da73e4fc2..00000000000000
--- a/llvm/test/Assembler/invalid-datalayout-alloca-addrspace.ll
+++ /dev/null
@@ -1,4 +0,0 @@
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-
-target datalayout = "A16777216"
-; CHECK: Invalid address space, must be a 24-bit integer
diff --git a/llvm/test/Assembler/invalid-datalayout-globals-addrspace.ll b/llvm/test/Assembler/invalid-datalayout-globals-addrspace.ll
deleted file mode 100644
index 19bf77db329d2c..00000000000000
--- a/llvm/test/Assembler/invalid-datalayout-globals-addrspace.ll
+++ /dev/null
@@ -1,4 +0,0 @@
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-
-; CHECK: Invalid address space, must be a 24-bit integer
-target datalayout = "G16777216"
diff --git a/llvm/test/Assembler/invalid-datalayout-index-size.ll b/llvm/test/Assembler/invalid-datalayout-index-size.ll
deleted file mode 100644
index dc608cdd56a040..00000000000000
--- a/llvm/test/Assembler/invalid-datalayout-index-size.ll
+++ /dev/null
@@ -1,3 +0,0 @@
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-target datalayout = "p:64:64:64:128"
-; CHECK: Index width cannot be larger than pointer width
diff --git a/llvm/test/Assembler/invalid-datalayout-program-addrspace.ll b/llvm/test/Assembler/invalid-datalayout-program-addrspace.ll
deleted file mode 100644
index e636b75dee4d04..00000000000000
--- a/llvm/test/Assembler/invalid-datalayout-program-addrspace.ll
+++ /dev/null
@@ -1,4 +0,0 @@
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-
-; CHECK: Invalid address space, must be a 24-bit integer
-target datalayout = "P16777216"
diff --git a/llvm/test/Assembler/invalid-datalayout1.ll b/llvm/test/Assembler/invalid-datalayout1.ll
deleted file mode 100644
index d1befdcdf294d5..00000000000000
--- a/llvm/test/Assembler/invalid-datalayout1.ll
+++ /dev/null
@@ -1,3 +0,0 @@
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-target datalayout = "^"
-; CHECK: Unknown specifier in datalayout string
diff --git a/llvm/test/Assembler/invalid-datalayout10.ll b/llvm/test/Assembler/invalid-datalayout10.ll
deleted file mode 100644
index 9f19688f852b4a..00000000000000
--- a/llvm/test/Assembler/invalid-datalayout10.ll
+++ /dev/null
@@ -1,3 +0,0 @@
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-target datalayout = "m"
-; CHECK: Expected mangling specifier in datalayout string
diff --git a/llvm/test/Assembler/invalid-datalayout11.ll b/llvm/test/Assembler/invalid-datalayout11.ll
deleted file mode 100644
index f8fed8ff9ff339..00000000000000
--- a/llvm/test/Assembler/invalid-datalayout11.ll
+++ /dev/null
@@ -1,3 +0,0 @@
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-target datalayout = "m."
-; CHECK: Unexpected trailing characters after mangling specifier in datalayout string
diff --git a/llvm/test/Assembler/invalid-datalayout12.ll b/llvm/test/Assembler/invalid-datalayout12.ll
deleted file mode 100644
index d79c196baab16f..00000000000000
--- a/llvm/test/Assembler/invalid-datalayout12.ll
+++ /dev/null
@@ -1,3 +0,0 @@
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-target datalayout = "f"
-; CHECK: Missing alignment specification in datalayout string
diff --git a/llvm/test/Assembler/invalid-datalayout13.ll b/llvm/test/Assembler/invalid-datalayout13.ll
deleted file mode 100644
index 5ac719dbb7a9c0..00000000000000
--- a/llvm/test/Assembler/invalid-datalayout13.ll
+++ /dev/null
@@ -1,3 +0,0 @@
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-target datalayout = ":32"
-; CHECK: Expected token before separator in datalayout string
diff --git a/llvm/test/Assembler/invalid-datalayout14.ll b/llvm/test/Assembler/invalid-datalayout14.ll
deleted file mode 100644
index 84634b52a146ca..00000000000000
--- a/llvm/test/Assembler/invalid-datalayout14.ll
+++ /dev/null
@@ -1,3 +0,0 @@
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-target datalayout = "i64:64:16"
-; CHECK: Preferred alignment cannot be less than the ABI alignment
diff --git a/llvm/test/Assembler/invalid-datalayout15.ll b/llvm/test/Assembler/invalid-datalayout15.ll
deleted file mode 100644
index ea240b73fd25f2..00000000000000
--- a/llvm/test/Assembler/invalid-datalayout15.ll
+++ /dev/null
@@ -1,3 +0,0 @@
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-target datalayout = "i64:16:16777216"
-; CHECK: Invalid preferred alignment, must be a 16bit integer
diff --git a/llvm/test/Assembler/invalid-datalayout16.ll b/llvm/test/Assembler/invalid-datalayout16.ll
deleted file mode 100644
index 0dd1abb629b6fc..00000000000000
--- a/llvm/test/Assembler/invalid-datalayout16.ll
+++ /dev/null
@@ -1,3 +0,0 @@
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-target datalayout = "i64:16777216:16777216"
-; CHECK: Invalid ABI alignment, must be a 16bit integer
diff --git a/llvm/test/Assembler/invalid-datalayout17.ll b/llvm/test/Assembler/invalid-datalayout17.ll
deleted file mode 100644
index b7eab74ad2a8ca..00000000000000
--- a/llvm/test/Assembler/invalid-datalayout17.ll
+++ /dev/null
@@ -1,3 +0,0 @@
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-target datalayout = "i16777216:16:16"
-; CHECK: Invalid bit width, must be a 24-bit integer
diff --git a/llvm/test/Assembler/invalid-datalayout18.ll b/llvm/test/Assembler/invalid-datalayout18.ll
deleted file mode 100644
index b9956f98c9c6dc..00000000000000
--- a/llvm/test/Assembler/invalid-datalayout18.ll
+++ /dev/null
@@ -1,3 +0,0 @@
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-target datalayout = "p:32:32:16"
-; CHECK: Preferred alignment cannot be less than the ABI alignment
diff --git a/llvm/test/Assembler/invalid-datalayout19.ll b/llvm/test/Assembler/invalid-datalayout19.ll
deleted file mode 100644
index fc0fc468520928..00000000000000
--- a/llvm/test/Assembler/invalid-datalayout19.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-
-target datalayout = "p:0:32:32"
-
-; CHECK: Invalid pointer size of 0 bytes
-
diff --git a/llvm/test/Assembler/invalid-datalayout2.ll b/llvm/test/Assembler/invalid-datalayout2.ll
deleted file mode 100644
index a435612bf85459..00000000000000
--- a/llvm/test/Assembler/invalid-datalayout2.ll
+++ /dev/null
@@ -1,3 +0,0 @@
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-target datalayout = "m:v"
-; CHECK: Unknown mangling in datalayout string
diff --git a/llvm/test/Assembler/invalid-datalayout20.ll b/llvm/test/Assembler/invalid-datalayout20.ll
deleted file mode 100644
index a9ac1d7fe0983a..00000000000000
--- a/llvm/test/Assembler/invalid-datalayout20.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-
-target datalayout = "p:64:24:64"
-
-; CHECK: Pointer ABI alignment must be a power of 2
-
diff --git a/llvm/test/Assembler/invalid-datalayout21.ll b/llvm/test/Assembler/invalid-datalayout21.ll
deleted file mode 100644
index a39d1d7a14a86b..00000000000000
--- a/llvm/test/Assembler/invalid-datalayout21.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-
-target datalayout = "p:64:64:24"
-
-; CHECK: Pointer preferred alignment must be a power of 2
-
diff --git a/llvm/test/Assembler/invalid-datalayout22.ll b/llvm/test/Assembler/invalid-datalayout22.ll
deleted file mode 100644
index 14e4c2822ce4b0..00000000000000
--- a/llvm/test/Assembler/invalid-datalayout22.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-
-target datalayout = "v128:0:128"
-
-; CHECK: ABI alignment specification must be >0 for non-aggregate types
-
diff --git a/llvm/test/Assembler/invalid-datalayout23.ll b/llvm/test/Assembler/invalid-datalayout23.ll
deleted file mode 100644
index 430326327bc116..00000000000000
--- a/llvm/test/Assembler/invalid-datalayout23.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-
-target datalayout = "i32:24:32"
-
-; CHECK: Invalid ABI alignment, must be a power of 2
-
diff --git a/llvm/test/Assembler/invalid-datalayout24.ll b/llvm/test/Assembler/invalid-datalayout24.ll
deleted file mode 100644
index 616ec64518a5b9..00000000000000
--- a/llvm/test/Assembler/invalid-datalayout24.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-
-target datalayout = "i32:32:24"
-
-; CHECK: Invalid preferred alignment, must be a power of 2
-
diff --git a/llvm/test/Assembler/invalid-datalayout3.ll b/llvm/test/Assembler/invalid-datalayout3.ll
deleted file mode 100644
index 44535fd055b5ea..00000000000000
--- a/llvm/test/Assembler/invalid-datalayout3.ll
+++ /dev/null
@@ -1,3 +0,0 @@
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-target datalayout = "n0"
-; CHECK: Zero width native integer type in datalayout string
diff --git a/llvm/test/Assembler/invalid-datalayout4.ll b/llvm/test/Assembler/invalid-datalayout4.ll
deleted file mode 100644
index 99a6a6093954e1..00000000000000
--- a/llvm/test/Assembler/invalid-datalayout4.ll
+++ /dev/null
@@ -1,3 +0,0 @@
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-target datalayout = "p16777216:64:64:64"
-; CHECK: Invalid address space, must be a 24-bit integer
diff --git a/llvm/test/Assembler/invalid-datalayout5.ll b/llvm/test/Assembler/invalid-datalayout5.ll
deleted file mode 100644
index 3ce8791c0870b4..00000000000000
--- a/llvm/test/Assembler/invalid-datalayout5.ll
+++ /dev/null
@@ -1,3 +0,0 @@
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-target datalayout = "a1:64"
-; CHECK: Sized aggregate specification in datalayout string
diff --git a/llvm/test/Assembler/invalid-datalayout6.ll b/llvm/test/Assembler/invalid-datalayout6.ll
deleted file mode 100644
index 425099f7cad869..00000000000000
--- a/llvm/test/Assembler/invalid-datalayout6.ll
+++ /dev/null
@@ -1,3 +0,0 @@
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-target datalayout = "a:"
-; CHECK: Trailing separator in datalayout string
diff --git a/llvm/test/Assembler/invalid-datalayout7.ll b/llvm/test/Assembler/invalid-datalayout7.ll
deleted file mode 100644
index 5e010710889f6d..00000000000000
--- a/llvm/test/Assembler/invalid-datalayout7.ll
+++ /dev/null
@@ -1,3 +0,0 @@
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-target datalayout = "p:48:52"
-; CHECK: number of bits must be a byte width multiple
diff --git a/llvm/test/Assembler/invalid-datalayout8.ll b/llvm/test/Assembler/invalid-datalayout8.ll
deleted file mode 100644
index 28832ffb17dd05..00000000000000
--- a/llvm/test/Assembler/invalid-datalayout8.ll
+++ /dev/null
@@ -1,3 +0,0 @@
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-target datalayout = "e-p"
-; CHECK: Missing size specification for pointer in datalayout string
diff --git a/llvm/test/Assembler/invalid-datalayout9.ll b/llvm/test/Assembler/invalid-datalayout9.ll
deleted file mode 100644
index dfeac65cf604d1..00000000000000
--- a/llvm/test/Assembler/invalid-datalayout9.ll
+++ /dev/null
@@ -1,3 +0,0 @@
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-target datalayout = "e-p:64"
-; CHECK: Missing alignment specification for pointer in datalayout string
diff --git a/llvm/unittests/IR/DataLayoutTest.cpp b/llvm/unittests/IR/DataLayoutTest.cpp
index 113bb578f6bc3b..dcb2e614f4c40d 100644
--- a/llvm/unittests/IR/DataLayoutTest.cpp
+++ b/llvm/unittests/IR/DataLayoutTest.cpp
@@ -19,6 +19,111 @@ using namespace llvm;
namespace {
+// TODO: Split into multiple TESTs.
+TEST(DataLayoutTest, ParseErrors) {
+ EXPECT_THAT_EXPECTED(
+ DataLayout::parse("^"),
+ FailedWithMessage("Unknown specifier in datalayout string"));
+ EXPECT_THAT_EXPECTED(
+ DataLayout::parse("m:v"),
+ FailedWithMessage("Unknown mangling in datalayout string"));
+ EXPECT_THAT_EXPECTED(
+ DataLayout::parse("n0"),
+ FailedWithMessage("Zero width native integer type in datalayout string"));
+ EXPECT_THAT_EXPECTED(
+ DataLayout::parse("p16777216:64:64:64"),
+ FailedWithMessage("Invalid address space, must be a 24-bit integer"));
+ EXPECT_THAT_EXPECTED(
+ DataLayout::parse("a1:64"),
+ FailedWithMessage("Sized aggregate specification in datalayout string"));
+ EXPECT_THAT_EXPECTED(
+ DataLayout::parse("a:"),
+ FailedWithMessage("Trailing separator in datalayout string"));
+ EXPECT_THAT_EXPECTED(
+ DataLayout::parse("p:48:52"),
+ FailedWithMessage("number of bits must be a byte width multiple"));
+ EXPECT_THAT_EXPECTED(
+ DataLayout::parse("e-p"),
+ FailedWithMessage(
+ "Missing size specification for pointer in datalayout string"));
+ EXPECT_THAT_EXPECTED(
+ DataLayout::parse("e-p:64"),
+ FailedWithMessage(
+ "Missing alignment specification for pointer in datalayout string"));
+ EXPECT_THAT_EXPECTED(
+ DataLayout::parse("m"),
+ FailedWithMessage("Expected mangling specifier in datalayout string"));
+ EXPECT_THAT_EXPECTED(
+ DataLayout::parse("m."),
+ FailedWithMessage("Unexpected trailing characters after mangling "
+ "specifier in datalayout string"));
+ EXPECT_THAT_EXPECTED(
+ DataLayout::parse("f"),
+ FailedWithMessage(
+ "Missing alignment specification in datalayout string"));
+ EXPECT_THAT_EXPECTED(
+ DataLayout::parse(":32"),
+ FailedWithMessage(
+ "Expected token before separator in datalayout string"));
+ EXPECT_THAT_EXPECTED(
+ DataLayout::parse("i64:64:16"),
+ FailedWithMessage(
+ "Preferred alignment cannot be less than the ABI alignment"));
+ EXPECT_THAT_EXPECTED(
+ DataLayout::parse("i64:16:16777216"),
+ FailedWithMessage(
+ "Invalid preferred alignment, must be a 16bit integer"));
+ EXPECT_THAT_EXPECTED(
+ DataLayout::parse("i64:16777216:16777216"),
+ FailedWithMessage("Invalid ABI alignment, must be a 16bit integer"));
+ EXPECT_THAT_EXPECTED(
+ DataLayout::parse("i16777216:16:16"),
+ FailedWithMessage("Invalid bit width, must be a 24-bit integer"));
+ EXPECT_THAT_EXPECTED(
+ DataLayout::parse("p:32:32:16"),
+ FailedWithMessage(
+ "Preferred alignment cannot be less than the ABI alignment"));
+ EXPECT_THAT_EXPECTED(DataLayout::parse("p:0:32:32"),
+ FailedWithMessage("Invalid pointer size of 0 bytes"));
+ EXPECT_THAT_EXPECTED(
+ DataLayout::parse("p:64:24:64"),
+ FailedWithMessage("Pointer ABI alignment must be a power of 2"));
+ EXPECT_THAT_EXPECTED(
+ DataLayout::parse("p:64:64:24"),
+ FailedWithMessage("Pointer preferred alignment must be a power of 2"));
+ EXPECT_THAT_EXPECTED(
+ DataLayout::parse("p:64:64:64:128"),
+ FailedWithMessage("Index width cannot be larger than pointer width"));
+ EXPECT_THAT_EXPECTED(
+ DataLayout::parse("v128:0:128"),
+ FailedWithMessage(
+ "ABI alignment specification must be >0 for non-aggregate types"));
+ EXPECT_THAT_EXPECTED(
+ DataLayout::parse("i32:24:32"),
+ FailedWithMessage("Invalid ABI alignment, must be a power of 2"));
+ EXPECT_THAT_EXPECTED(
+ DataLayout::parse("i32:32:24"),
+ FailedWithMessage("Invalid preferred alignment, must be a power of 2"));
+ EXPECT_THAT_EXPECTED(
+ DataLayout::parse("A16777216"),
+ FailedWithMessage("Invalid address space, must be a 24-bit integer"));
+ EXPECT_THAT_EXPECTED(
+ DataLayout::parse("G16777216"),
+ FailedWithMessage("Invalid address space, must be a 24-bit integer"));
+ EXPECT_THAT_EXPECTED(
+ DataLayout::parse("P16777216"),
+ FailedWithMessage("Invalid address space, must be a 24-bit integer"));
+ EXPECT_THAT_EXPECTED(
+ DataLayout::parse("Fi24"),
+ FailedWithMessage("Alignment is neither 0 nor a power of 2"));
+ EXPECT_THAT_EXPECTED(
+ DataLayout::parse("i8:16"),
+ FailedWithMessage("Invalid ABI alignment, i8 must be naturally aligned"));
+ EXPECT_THAT_EXPECTED(
+ DataLayout::parse("S24"),
+ FailedWithMessage("Alignment is neither 0 nor a power of 2"));
+}
+
TEST(DataLayoutTest, CopyAssignmentInvalidatesStructLayout) {
DataLayout DL1 = cantFail(DataLayout::parse("p:32:32"));
DataLayout DL2 = cantFail(DataLayout::parse("p:64:64"));
``````````
</details>
https://github.com/llvm/llvm-project/pull/104346
More information about the llvm-commits
mailing list