r188931 - TBAA: add testing case to check typedef can alias.
Manman Ren
manman.ren at gmail.com
Wed Aug 21 14:00:10 PDT 2013
Author: mren
Date: Wed Aug 21 16:00:10 2013
New Revision: 188931
URL: http://llvm.org/viewvc/llvm-project?rev=188931&view=rev
Log:
TBAA: add testing case to check typedef can alias.
Modified:
cfe/trunk/test/CodeGen/tbaa.cpp
Modified: cfe/trunk/test/CodeGen/tbaa.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/tbaa.cpp?rev=188931&r1=188930&r2=188931&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/tbaa.cpp (original)
+++ cfe/trunk/test/CodeGen/tbaa.cpp Wed Aug 21 16:00:10 2013
@@ -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]]}
More information about the cfe-commits
mailing list