diff options
author | Bruno De Fraine <brunodf@synopsys.com> | 2022-07-06 14:36:14 +0200 |
---|---|---|
committer | Jeroen Dobbelaere <jeroen.dobbelaere@synopsys.com> | 2022-07-06 14:37:59 +0200 |
commit | 5b3247bf9f715cc1b399af1e17540b3a3ce9cdec (patch) | |
tree | cd785394d01a1ea81bcc54f0ed7e42960f68479f /clang/unittests | |
parent | 2c915e3b2627a4e03341e14b354915c58741d7ec (diff) | |
download | llvm-5b3247bf9f715cc1b399af1e17540b3a3ce9cdec.zip llvm-5b3247bf9f715cc1b399af1e17540b3a3ce9cdec.tar.gz llvm-5b3247bf9f715cc1b399af1e17540b3a3ce9cdec.tar.bz2 |
[tbaa] Handle base classes in struct tbaa
This is a fix for the miscompilation reported in https://github.com/llvm/llvm-project/issues/55384
Not adding a new test case since existing test cases already cover base classes (including new-struct-path tbaa).
Reviewed By: jeroen.dobbelaere
Differential Revision: https://reviews.llvm.org/D126956
Diffstat (limited to 'clang/unittests')
-rw-r--r-- | clang/unittests/CodeGen/TBAAMetadataTest.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/clang/unittests/CodeGen/TBAAMetadataTest.cpp b/clang/unittests/CodeGen/TBAAMetadataTest.cpp index 149a8e074..2919a35 100644 --- a/clang/unittests/CodeGen/TBAAMetadataTest.cpp +++ b/clang/unittests/CodeGen/TBAAMetadataTest.cpp @@ -968,13 +968,10 @@ TEST(TBAAMetadataTest, BaseClass) { MConstInt(0)), MConstInt(0)); - auto ClassDerived = MMTuple( - MMString("_ZTS7Derived"), - MMTuple( - MMString("short"), - OmnipotentCharCXX, - MConstInt(0)), - MConstInt(4)); + auto ClassDerived = + MMTuple(MMString("_ZTS7Derived"), ClassBase, MConstInt(0), + MMTuple(MMString("short"), OmnipotentCharCXX, MConstInt(0)), + MConstInt(4)); const Instruction *I = match(BB, MInstruction(Instruction::Store, @@ -1047,13 +1044,10 @@ TEST(TBAAMetadataTest, PolymorphicClass) { MConstInt(0)), MConstInt(Compiler.PtrSize)); - auto ClassDerived = MMTuple( - MMString("_ZTS7Derived"), - MMTuple( - MMString("short"), - OmnipotentCharCXX, - MConstInt(0)), - MConstInt(Compiler.PtrSize + 4)); + auto ClassDerived = + MMTuple(MMString("_ZTS7Derived"), ClassBase, MConstInt(0), + MMTuple(MMString("short"), OmnipotentCharCXX, MConstInt(0)), + MConstInt(Compiler.PtrSize + 4)); const Instruction *I = match(BB, MInstruction(Instruction::Store, |