From: Manman Ren Date: Wed, 21 Aug 2013 21:00:10 +0000 (+0000) Subject: TBAA: add testing case to check typedef can alias. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8183b8ea9f39c8f3f9ea8b24d5c5a56f1eb00ed2;p=clang TBAA: add testing case to check typedef can alias. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188931 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGen/tbaa.cpp b/test/CodeGen/tbaa.cpp index e1fc7a79be..e931930a52 100644 --- a/test/CodeGen/tbaa.cpp +++ b/test/CodeGen/tbaa.cpp @@ -222,6 +222,20 @@ char g14(struct six *a, struct six *b) { return a->b; } +// Types that differ only by name may alias. +typedef StructS StructS3; +uint32_t g15(StructS *S, StructS3 *S3, uint64_t count) { +// CHECK: define i32 @{{.*}}( +// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]] +// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]] +// PATH: define i32 @{{.*}}( +// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_S_f32]] +// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_S_f32]] + S->f32 = 1; + S3->f32 = 4; + return S->f32; +} + // CHECK: [[TAG_char]] = metadata !{metadata !"omnipotent char", metadata [[TAG_cxx_tbaa:!.*]]} // CHECK: [[TAG_cxx_tbaa]] = metadata !{metadata !"Simple C/C++ TBAA"} // CHECK: [[TAG_i32]] = metadata !{metadata !"int", metadata [[TAG_char]]}