summaryrefslogtreecommitdiff
path: root/test/esan
diff options
context:
space:
mode:
authorQin Zhao <zhaoqin@google.com>2016-06-10 02:10:34 +0000
committerQin Zhao <zhaoqin@google.com>2016-06-10 02:10:34 +0000
commite00c72b6b97e99f07f0f6b79f83a4e446592577d (patch)
treec92e4e74f31f9cb10a62f30effa66acc93f7b738 /test/esan
parent180059d601ada3d56fbcb26287b0d792791fe22f (diff)
[esan|cfrag] Add the struct field offset array in StructInfo
Summary: Adds the struct field offset array in the struct StructInfo. Prints struct size and field offset info in the report. Reviewers: aizatsky Subscribers: vitalybuka, zhaoqin, kcc, eugenis, bruening, llvm-commits, kubabrecka Differential Revision: http://reviews.llvm.org/D21191 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@272363 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/esan')
-rw-r--r--test/esan/TestCases/struct-simple.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/test/esan/TestCases/struct-simple.cpp b/test/esan/TestCases/struct-simple.cpp
index 0e6dbab5c..155f7d19a 100644
--- a/test/esan/TestCases/struct-simple.cpp
+++ b/test/esan/TestCases/struct-simple.cpp
@@ -142,48 +142,48 @@ int main(int argc, char **argv) {
// CHECK-NEXT: in esan::processCacheFragCompilationUnitExit: {{.*}}struct-simple.cpp with 5 class(es)/struct(s)
// CHECK-NEXT: Unregister class.C#3#14#13#13: 3 fields
// CHECK-NEXT: {{.*}} class C
- // CHECK-NEXT: {{.*}} count = 5, ratio = 3
- // CHECK-NEXT: {{.*}} # 0: count = 2, type = %struct.anon = type { i32, i32 }
- // CHECK-NEXT: {{.*}} # 1: count = 2, type = %union.anon = type { double }
- // CHECK-NEXT: {{.*}} # 2: count = 1, type = [10 x i8]
+ // CHECK-NEXT: {{.*}} size = 32, count = 5, ratio = 3
+ // CHECK-NEXT: {{.*}} # 0: offset = 0, count = 2, type = %struct.anon = type { i32, i32 }
+ // CHECK-NEXT: {{.*}} # 1: offset = 8, count = 2, type = %union.anon = type { double }
+ // CHECK-NEXT: {{.*}} # 2: offset = 16, count = 1, type = [10 x i8]
// CHECK-NEXT: Unregister struct.anon#2#11#11: 2 fields
// CHECK-NEXT: {{.*}} struct anon
- // CHECK-NEXT: {{.*}} count = 2, ratio = 1
- // CHECK-NEXT: {{.*}} # 0: count = 1, type = i32
- // CHECK-NEXT: {{.*}} # 1: count = 1, type = i32
+ // CHECK-NEXT: {{.*}} size = 8, count = 2, ratio = 1
+ // CHECK-NEXT: {{.*}} # 0: offset = 0, count = 1, type = i32
+ // CHECK-NEXT: {{.*}} # 1: offset = 4, count = 1, type = i32
// CHECK-NEXT: Unregister union.anon#1#3: 1 fields
// CHECK-NEXT: Unregister struct.S#2#11#11: 2 fields
// CHECK-NEXT: {{.*}} struct S
- // CHECK-NEXT: {{.*}} count = 2, ratio = 2
- // CHECK-NEXT: {{.*}} # 0: count = 2, type = i32
- // CHECK-NEXT: {{.*}} # 1: count = 0, type = i32
+ // CHECK-NEXT: {{.*}} size = 8, count = 2, ratio = 2
+ // CHECK-NEXT: {{.*}} # 0: offset = 0, count = 2, type = i32
+ // CHECK-NEXT: {{.*}} # 1: offset = 4, count = 0, type = i32
// CHECK-NEXT: Unregister struct.D#3#11#11#11: 3 fields
// CHECK-NEXT: {{.*}} struct D
- // CHECK-NEXT: {{.*}} count = 2, ratio = 2
- // CHECK-NEXT: {{.*}} # 0: count = 1, type = i32
- // CHECK-NEXT: {{.*}} # 1: count = 1, type = i32
- // CHECK-NEXT: {{.*}} # 2: count = 0, type = i32
+ // CHECK-NEXT: {{.*}} size = 12, count = 2, ratio = 2
+ // CHECK-NEXT: {{.*}} # 0: offset = 0, count = 1, type = i32
+ // CHECK-NEXT: {{.*}} # 1: offset = 4, count = 1, type = i32
+ // CHECK-NEXT: {{.*}} # 2: offset = 8, count = 0, type = i32
// CHECK-NEXT: in esan::processCompilationUnitExit
// CHECK-NEXT: in esan::processCacheFragCompilationUnitExit: {{.*}}struct-simple.cpp with 0 class(es)/struct(s)
// CHECK-NEXT: in esan::processCompilationUnitExit
// CHECK-NEXT: in esan::processCacheFragCompilationUnitExit: {{.*}}struct-simple.cpp with 5 class(es)/struct(s)
// CHECK-NEXT: Unregister struct.A#2#11#11: 2 fields
// CHECK-NEXT: {{.*}} struct A
- // CHECK-NEXT: {{.*}} count = 2049, ratio = 2048
- // CHECK-NEXT: {{.*}} # 0: count = 2048, type = i32
- // CHECK-NEXT: {{.*}} # 1: count = 1, type = i32
+ // CHECK-NEXT: {{.*}} size = 8, count = 2049, ratio = 2048
+ // CHECK-NEXT: {{.*}} # 0: offset = 0, count = 2048, type = i32
+ // CHECK-NEXT: {{.*}} # 1: offset = 4, count = 1, type = i32
// CHECK-NEXT: Unregister struct.B#2#3#2: 2 fields
// CHECK-NEXT: {{.*}} struct B
- // CHECK-NEXT: {{.*}} count = 2097153, ratio = 2097152
- // CHECK-NEXT: {{.*}} # 0: count = 1, type = float
- // CHECK-NEXT: {{.*}} # 1: count = 2097152, type = double
+ // CHECK-NEXT: {{.*}} size = 16, count = 2097153, ratio = 2097152
+ // CHECK-NEXT: {{.*}} # 0: offset = 0, count = 1, type = float
+ // CHECK-NEXT: {{.*}} # 1: offset = 8, count = 2097152, type = double
// CHECK-NEXT: Unregister union.U#1#3: 1 fields
// CHECK-NEXT: Duplicated struct.S#2#11#11: 2 fields
// CHECK-NEXT: Unregister struct.D#2#11#11: 2 fields
// CHECK-NEXT: {{.*}} struct D
- // CHECK-NEXT: {{.*}} count = 1, ratio = 1
- // CHECK-NEXT: {{.*}} # 0: count = 1, type = i32
- // CHECK-NEXT: {{.*}} # 1: count = 0, type = i32
+ // CHECK-NEXT: {{.*}} size = 8, count = 1, ratio = 1
+ // CHECK-NEXT: {{.*}} # 0: offset = 0, count = 1, type = i32
+ // CHECK-NEXT: {{.*}} # 1: offset = 4, count = 0, type = i32
// CHECK-NEXT: {{.*}}EfficiencySanitizer: total struct field access count = 2099214
}
#endif // MAIN