llvm.org GIT mirror llvm / 2bbac40
[esan:cfrag] Add option -esan-aux-field-info Summary: Adds option -esan-aux-field-info to control generating binary with auxiliary struct field information. Extracts code for creating auxiliary information from createCacheFragInfoGV into createCacheFragAuxGV. Adds test struct_field_small.ll for -esan-aux-field-info test. Reviewers: aizatsky Subscribers: llvm-commits, bruening, eugenis, kcc, zhaoqin, vitalybuka Differential Revision: http://reviews.llvm.org/D22019 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274726 91177308-0d34-0410-b5e6-96231b3b80d8 Qin Zhao 4 years ago
2 changed file(s) with 199 addition(s) and 44 deletion(s). Raw diff Collapse all Expand all
6060 static cl::opt ClInstrumentFastpath(
6161 "esan-instrument-fastpath", cl::init(true),
6262 cl::desc("Instrument fastpath"), cl::Hidden);
63 static cl::opt ClAuxFieldInfo(
64 "esan-aux-field-info", cl::init(true),
65 cl::desc("Generate binary with auxiliary struct field information"),
66 cl::Hidden);
6367
6468 // Experiments show that the performance difference can be 2x or more,
6569 // and accuracy loss is typically negligible, so we turn this on by default.
160164 bool shouldIgnoreStructType(StructType *StructTy);
161165 void createStructCounterName(
162166 StructType *StructTy, SmallString &NameStr);
167 void createCacheFragAuxGV(
168 Module &M, const DataLayout &DL, StructType *StructTy,
169 GlobalVariable *&TypeNames, GlobalVariable *&Offsets, GlobalVariable *&Size);
163170 GlobalVariable *createCacheFragInfoGV(Module &M, const DataLayout &DL,
164171 Constant *UnitName);
165172 Constant *createEsanInitToolInfoArg(Module &M, const DataLayout &DL);
311318 }
312319 }
313320
321 // Create global variables with auxiliary information (e.g., struct field size,
322 // offset, and type name) for better user report.
323 void EfficiencySanitizer::createCacheFragAuxGV(
324 Module &M, const DataLayout &DL, StructType *StructTy,
325 GlobalVariable *&TypeName, GlobalVariable *&Offset,
326 GlobalVariable *&Size) {
327 auto *Int8PtrTy = Type::getInt8PtrTy(*Ctx);
328 auto *Int32Ty = Type::getInt32Ty(*Ctx);
329 // FieldTypeName.
330 auto *TypeNameArrayTy = ArrayType::get(Int8PtrTy, StructTy->getNumElements());
331 TypeName = new GlobalVariable(M, TypeNameArrayTy, true,
332 GlobalVariable::InternalLinkage, nullptr);
333 SmallVector TypeNameVec;
334 // FieldOffset.
335 auto *OffsetArrayTy = ArrayType::get(Int32Ty, StructTy->getNumElements());
336 Offset = new GlobalVariable(M, OffsetArrayTy, true,
337 GlobalVariable::InternalLinkage, nullptr);
338 SmallVector OffsetVec;
339 // FieldSize
340 auto *SizeArrayTy = ArrayType::get(Int32Ty, StructTy->getNumElements());
341 Size = new GlobalVariable(M, SizeArrayTy, true,
342 GlobalVariable::InternalLinkage, nullptr);
343 SmallVector SizeVec;
344 for (unsigned i = 0; i < StructTy->getNumElements(); ++i) {
345 Type *Ty = StructTy->getElementType(i);
346 std::string Str;
347 raw_string_ostream StrOS(Str);
348 Ty->print(StrOS);
349 TypeNameVec.push_back(
350 ConstantExpr::getPointerCast(
351 createPrivateGlobalForString(M, StrOS.str(), true),
352 Int8PtrTy));
353 OffsetVec.push_back(
354 ConstantInt::get(Int32Ty,
355 DL.getStructLayout(StructTy)->getElementOffset(i)));
356 SizeVec.push_back(ConstantInt::get(Int32Ty,
357 DL.getTypeAllocSize(Ty)));
358 }
359 TypeName->setInitializer(ConstantArray::get(TypeNameArrayTy, TypeNameVec));
360 Offset->setInitializer(ConstantArray::get(OffsetArrayTy, OffsetVec));
361 Size->setInitializer(ConstantArray::get(SizeArrayTy, SizeVec));
362 }
363
314364 // Create the global variable for the cache-fragmentation tool.
315365 GlobalVariable *EfficiencySanitizer::createCacheFragInfoGV(
316366 Module &M, const DataLayout &DL, Constant *UnitName) {
328378 // const char *StructName;
329379 // u32 Size;
330380 // u32 NumFields;
331 // u32 *FieldOffsets;
332 // u32 *FieldSize;
333 // const char **FieldTypeNames;
381 // u32 *FieldOffset; // auxiliary struct field info.
382 // u32 *FieldSize; // auxiliary struct field info.
383 // const char **FieldTypeName; // auxiliary struct field info.
334384 // u64 *FieldCounters;
335385 // u64 *ArrayCounter;
336386 // };
380430 // Remember the counter variable for each struct type.
381431 StructTyMap.insert(std::pair(StructTy, Counters));
382432
383 // We pass the field type name array and offset array to the runtime for
384 // better reporting.
385 // FieldTypeNames.
386 auto *TypeNameArrayTy = ArrayType::get(Int8PtrTy, StructTy->getNumElements());
387 GlobalVariable *TypeNames =
388 new GlobalVariable(M, TypeNameArrayTy, true,
389 GlobalVariable::InternalLinkage, nullptr);
390 SmallVector TypeNameVec;
391 // FieldOffsets.
392 const StructLayout *SL = DL.getStructLayout(StructTy);
393 auto *OffsetArrayTy = ArrayType::get(Int32Ty, StructTy->getNumElements());
394 GlobalVariable *Offsets =
395 new GlobalVariable(M, OffsetArrayTy, true,
396 GlobalVariable::InternalLinkage, nullptr);
397 SmallVector OffsetVec;
398 // FieldSize
399 auto *SizeArrayTy = ArrayType::get(Int32Ty, StructTy->getNumElements());
400 GlobalVariable *Size =
401 new GlobalVariable(M, SizeArrayTy, true,
402 GlobalVariable::InternalLinkage, nullptr);
403 SmallVector SizeVec;
404 for (unsigned i = 0; i < StructTy->getNumElements(); ++i) {
405 Type *Ty = StructTy->getElementType(i);
406 std::string Str;
407 raw_string_ostream StrOS(Str);
408 Ty->print(StrOS);
409 TypeNameVec.push_back(
410 ConstantExpr::getPointerCast(
411 createPrivateGlobalForString(M, StrOS.str(), true),
412 Int8PtrTy));
413 OffsetVec.push_back(ConstantInt::get(Int32Ty, SL->getElementOffset(i)));
414 SizeVec.push_back(ConstantInt::get(Int32Ty,
415 DL.getTypeAllocSize(Ty)));
416 }
417 TypeNames->setInitializer(ConstantArray::get(TypeNameArrayTy, TypeNameVec));
418 Offsets->setInitializer(ConstantArray::get(OffsetArrayTy, OffsetVec));
419 Size->setInitializer(ConstantArray::get(SizeArrayTy, SizeVec));
433 // We pass the field type name array, offset array, and size array to
434 // the runtime for better reporting.
435 GlobalVariable *TypeName = nullptr, *Offset = nullptr, *Size = nullptr;
436 if (ClAuxFieldInfo)
437 createCacheFragAuxGV(M, DL, StructTy, TypeName, Offset, Size);
420438
421439 Constant *FieldCounterIdx[2];
422440 FieldCounterIdx[0] = ConstantInt::get(Int32Ty, 0);
430448 ConstantStruct::get(
431449 StructInfoTy,
432450 ConstantExpr::getPointerCast(StructCounterName, Int8PtrTy),
433 ConstantInt::get(Int32Ty, SL->getSizeInBytes()),
451 ConstantInt::get(Int32Ty,
452 DL.getStructLayout(StructTy)->getSizeInBytes()),
434453 ConstantInt::get(Int32Ty, StructTy->getNumElements()),
435 ConstantExpr::getPointerCast(Offsets, Int32PtrTy),
436 ConstantExpr::getPointerCast(Size, Int32PtrTy),
437 ConstantExpr::getPointerCast(TypeNames, Int8PtrPtrTy),
454 Offset == nullptr ? ConstantPointerNull::get(Int32PtrTy) :
455 ConstantExpr::getPointerCast(Offset, Int32PtrTy),
456 Size == nullptr ? ConstantPointerNull::get(Int32PtrTy) :
457 ConstantExpr::getPointerCast(Size, Int32PtrTy),
458 TypeName == nullptr ? ConstantPointerNull::get(Int8PtrPtrTy) :
459 ConstantExpr::getPointerCast(TypeName, Int8PtrPtrTy),
438460 ConstantExpr::getGetElementPtr(CounterArrayTy, Counters,
439461 FieldCounterIdx),
440462 ConstantExpr::getGetElementPtr(CounterArrayTy, Counters,
0 ; Test basic EfficiencySanitizer struct field count instrumentation with -esan-small-binary
1 ;
2 ; RUN: opt < %s -esan -esan-cache-frag -esan-aux-field-info=false -S | FileCheck %s
3
4 %struct.A = type { i32, i32 }
5 %union.U = type { double }
6 %struct.C = type { %struct.anon, %union.anon, [10 x i8] }
7 %struct.anon = type { i32, i32 }
8 %union.anon = type { double }
9
10 ; CHECK: @0 = private unnamed_addr constant [8 x i8] c"\00", align 1
11 ; CHECK-NEXT: @1 = private unnamed_addr constant [17 x i8] c"struct.A#2#11#11\00", align 1
12 ; CHECK-NEXT: @"struct.A#2#11#11" = weak global [3 x i64] zeroinitializer
13 ; CHECK-NEXT: @2 = private unnamed_addr constant [12 x i8] c"union.U#1#3\00", align 1
14 ; CHECK-NEXT: @"union.U#1#3" = weak global [2 x i64] zeroinitializer
15 ; CHECK-NEXT: @3 = private unnamed_addr constant [20 x i8] c"struct.C#3#14#13#13\00", align 1
16 ; CHECK-NEXT: @"struct.C#3#14#13#13" = weak global [4 x i64] zeroinitializer
17 ; CHECK-NEXT: @4 = private unnamed_addr constant [20 x i8] c"struct.anon#2#11#11\00", align 1
18 ; CHECK-NEXT: @"struct.anon#2#11#11" = weak global [3 x i64] zeroinitializer
19 ; CHECK-NEXT: @5 = private unnamed_addr constant [15 x i8] c"union.anon#1#3\00", align 1
20 ; CHECK-NEXT: @"union.anon#1#3" = weak global [2 x i64] zeroinitializer
21 ; CHECK-NEXT: @6 = internal global [5 x { i8*, i32, i32, i32*, i32*, i8**, i64*, i64* }] [{ i8*, i32, i32, i32*, i32*, i8**, i64*, i64* } { i8* getelementptr inbounds ([17 x i8], [17 x i8]* @1, i32 0, i32 0), i32 8, i32 2, i32* null, i32* null, i8** null, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @"struct.A#2#11#11", i32 0, i32 0), i64* getelementptr inbounds ([3 x i64], [3 x i64]* @"struct.A#2#11#11", i32 0, i32 2) }, { i8*, i32, i32, i32*, i32*, i8**, i64*, i64* } { i8* getelementptr inbounds ([12 x i8], [12 x i8]* @2, i32 0, i32 0), i32 8, i32 1, i32* null, i32* null, i8** null, i64* getelementptr inbounds ([2 x i64], [2 x i64]* @"union.U#1#3", i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* @"union.U#1#3", i32 0, i32 1) }, { i8*, i32, i32, i32*, i32*, i8**, i64*, i64* } { i8* getelementptr inbounds ([20 x i8], [20 x i8]* @3, i32 0, i32 0), i32 32, i32 3, i32* null, i32* null, i8** null, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @"struct.C#3#14#13#13", i32 0, i32 0), i64* getelementptr inbounds ([4 x i64], [4 x i64]* @"struct.C#3#14#13#13", i32 0, i32 3) }, { i8*, i32, i32, i32*, i32*, i8**, i64*, i64* } { i8* getelementptr inbounds ([20 x i8], [20 x i8]* @4, i32 0, i32 0), i32 8, i32 2, i32* null, i32* null, i8** null, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @"struct.anon#2#11#11", i32 0, i32 0), i64* getelementptr inbounds ([3 x i64], [3 x i64]* @"struct.anon#2#11#11", i32 0, i32 2) }, { i8*, i32, i32, i32*, i32*, i8**, i64*, i64* } { i8* getelementptr inbounds ([15 x i8], [15 x i8]* @5, i32 0, i32 0), i32 8, i32 1, i32* null, i32* null, i8** null, i64* getelementptr inbounds ([2 x i64], [2 x i64]* @"union.anon#1#3", i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* @"union.anon#1#3", i32 0, i32 1) }]
22 ; CHECK-NEXT: @7 = internal constant { i8*, i32, { i8*, i32, i32, i32*, i32*, i8**, i64*, i64* }* } { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @0, i32 0, i32 0), i32 5, { i8*, i32, i32, i32*, i32*, i8**, i64*, i64* }* getelementptr inbounds ([5 x { i8*, i32, i32, i32*, i32*, i8**, i64*, i64* }], [5 x { i8*, i32, i32, i32*, i32*, i8**, i64*, i64* }]* @6, i32 0, i32 0) }
23
24 define i32 @main() {
25 entry:
26 %a = alloca %struct.A, align 4
27 %u = alloca %union.U, align 8
28 %c = alloca [2 x %struct.C], align 16
29 %k = alloca %struct.A*, align 8
30 %x = getelementptr inbounds %struct.A, %struct.A* %a, i32 0, i32 0
31 %y = getelementptr inbounds %struct.A, %struct.A* %a, i32 0, i32 1
32 %f = bitcast %union.U* %u to float*
33 %d = bitcast %union.U* %u to double*
34 %arrayidx = getelementptr inbounds [2 x %struct.C], [2 x %struct.C]* %c, i64 0, i64 0
35 %cs = getelementptr inbounds %struct.C, %struct.C* %arrayidx, i32 0, i32 0
36 %x1 = getelementptr inbounds %struct.anon, %struct.anon* %cs, i32 0, i32 0
37 %arrayidx2 = getelementptr inbounds [2 x %struct.C], [2 x %struct.C]* %c, i64 0, i64 1
38 %cs3 = getelementptr inbounds %struct.C, %struct.C* %arrayidx2, i32 0, i32 0
39 %y4 = getelementptr inbounds %struct.anon, %struct.anon* %cs3, i32 0, i32 1
40 %arrayidx5 = getelementptr inbounds [2 x %struct.C], [2 x %struct.C]* %c, i64 0, i64 0
41 %cu = getelementptr inbounds %struct.C, %struct.C* %arrayidx5, i32 0, i32 1
42 %f6 = bitcast %union.anon* %cu to float*
43 %arrayidx7 = getelementptr inbounds [2 x %struct.C], [2 x %struct.C]* %c, i64 0, i64 1
44 %cu8 = getelementptr inbounds %struct.C, %struct.C* %arrayidx7, i32 0, i32 1
45 %d9 = bitcast %union.anon* %cu8 to double*
46 %arrayidx10 = getelementptr inbounds [2 x %struct.C], [2 x %struct.C]* %c, i64 0, i64 0
47 %c11 = getelementptr inbounds %struct.C, %struct.C* %arrayidx10, i32 0, i32 2
48 %arrayidx12 = getelementptr inbounds [10 x i8], [10 x i8]* %c11, i64 0, i64 2
49 %k1 = load %struct.A*, %struct.A** %k, align 8
50 %arrayidx13 = getelementptr inbounds %struct.A, %struct.A* %k1, i64 0
51 ret i32 0
52 }
53
54 ; CHECK: @llvm.global_ctors = {{.*}}@esan.module_ctor
55 ; CHECK: @llvm.global_dtors = {{.*}}@esan.module_dtor
56
57 ; CHECK: %a = alloca %struct.A, align 4
58 ; CHECK-NEXT: %u = alloca %union.U, align 8
59 ; CHECK-NEXT: %c = alloca [2 x %struct.C], align 16
60 ; CHECK-NEXT: %k = alloca %struct.A*, align 8
61 ; CHECK-NEXT: %0 = load i64, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @"struct.A#2#11#11", i32 0, i32 0)
62 ; CHECK-NEXT: %1 = add i64 %0, 1
63 ; CHECK-NEXT: store i64 %1, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @"struct.A#2#11#11", i32 0, i32 0)
64 ; CHECK-NEXT: %x = getelementptr inbounds %struct.A, %struct.A* %a, i32 0, i32 0
65 ; CHECK-NEXT: %2 = load i64, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @"struct.A#2#11#11", i32 0, i32 1)
66 ; CHECK-NEXT: %3 = add i64 %2, 1
67 ; CHECK-NEXT: store i64 %3, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @"struct.A#2#11#11", i32 0, i32 1)
68 ; CHECK-NEXT: %y = getelementptr inbounds %struct.A, %struct.A* %a, i32 0, i32 1
69 ; CHECK-NEXT: %f = bitcast %union.U* %u to float*
70 ; CHECK-NEXT: %d = bitcast %union.U* %u to double*
71 ; CHECK-NEXT: %4 = load i64, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @"struct.C#3#14#13#13", i32 0, i32 3)
72 ; CHECK-NEXT: %5 = add i64 %4, 1
73 ; CHECK-NEXT: store i64 %5, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @"struct.C#3#14#13#13", i32 0, i32 3)
74 ; CHECK-NEXT: %arrayidx = getelementptr inbounds [2 x %struct.C], [2 x %struct.C]* %c, i64 0, i64 0
75 ; CHECK-NEXT: %6 = load i64, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @"struct.C#3#14#13#13", i32 0, i32 0)
76 ; CHECK-NEXT: %7 = add i64 %6, 1
77 ; CHECK-NEXT: store i64 %7, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @"struct.C#3#14#13#13", i32 0, i32 0)
78 ; CHECK-NEXT: %cs = getelementptr inbounds %struct.C, %struct.C* %arrayidx, i32 0, i32 0
79 ; CHECK-NEXT: %8 = load i64, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @"struct.anon#2#11#11", i32 0, i32 0)
80 ; CHECK-NEXT: %9 = add i64 %8, 1
81 ; CHECK-NEXT: store i64 %9, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @"struct.anon#2#11#11", i32 0, i32 0)
82 ; CHECK-NEXT: %x1 = getelementptr inbounds %struct.anon, %struct.anon* %cs, i32 0, i32 0
83 ; CHECK-NEXT: %10 = load i64, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @"struct.C#3#14#13#13", i32 0, i32 3)
84 ; CHECK-NEXT: %11 = add i64 %10, 1
85 ; CHECK-NEXT: store i64 %11, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @"struct.C#3#14#13#13", i32 0, i32 3)
86 ; CHECK-NEXT: %arrayidx2 = getelementptr inbounds [2 x %struct.C], [2 x %struct.C]* %c, i64 0, i64 1
87 ; CHECK-NEXT: %12 = load i64, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @"struct.C#3#14#13#13", i32 0, i32 0)
88 ; CHECK-NEXT: %13 = add i64 %12, 1
89 ; CHECK-NEXT: store i64 %13, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @"struct.C#3#14#13#13", i32 0, i32 0)
90 ; CHECK-NEXT: %cs3 = getelementptr inbounds %struct.C, %struct.C* %arrayidx2, i32 0, i32 0
91 ; CHECK-NEXT: %14 = load i64, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @"struct.anon#2#11#11", i32 0, i32 1)
92 ; CHECK-NEXT: %15 = add i64 %14, 1
93 ; CHECK-NEXT: store i64 %15, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @"struct.anon#2#11#11", i32 0, i32 1)
94 ; CHECK-NEXT: %y4 = getelementptr inbounds %struct.anon, %struct.anon* %cs3, i32 0, i32 1
95 ; CHECK-NEXT: %16 = load i64, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @"struct.C#3#14#13#13", i32 0, i32 3)
96 ; CHECK-NEXT: %17 = add i64 %16, 1
97 ; CHECK-NEXT: store i64 %17, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @"struct.C#3#14#13#13", i32 0, i32 3)
98 ; CHECK-NEXT: %arrayidx5 = getelementptr inbounds [2 x %struct.C], [2 x %struct.C]* %c, i64 0, i64 0
99 ; CHECK-NEXT: %18 = load i64, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @"struct.C#3#14#13#13", i32 0, i32 1)
100 ; CHECK-NEXT: %19 = add i64 %18, 1
101 ; CHECK-NEXT: store i64 %19, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @"struct.C#3#14#13#13", i32 0, i32 1)
102 ; CHECK-NEXT: %cu = getelementptr inbounds %struct.C, %struct.C* %arrayidx5, i32 0, i32 1
103 ; CHECK-NEXT: %f6 = bitcast %union.anon* %cu to float*
104 ; CHECK-NEXT: %20 = load i64, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @"struct.C#3#14#13#13", i32 0, i32 3)
105 ; CHECK-NEXT: %21 = add i64 %20, 1
106 ; CHECK-NEXT: store i64 %21, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @"struct.C#3#14#13#13", i32 0, i32 3)
107 ; CHECK-NEXT: %arrayidx7 = getelementptr inbounds [2 x %struct.C], [2 x %struct.C]* %c, i64 0, i64 1
108 ; CHECK-NEXT: %22 = load i64, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @"struct.C#3#14#13#13", i32 0, i32 1)
109 ; CHECK-NEXT: %23 = add i64 %22, 1
110 ; CHECK-NEXT: store i64 %23, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @"struct.C#3#14#13#13", i32 0, i32 1)
111 ; CHECK-NEXT: %cu8 = getelementptr inbounds %struct.C, %struct.C* %arrayidx7, i32 0, i32 1
112 ; CHECK-NEXT: %d9 = bitcast %union.anon* %cu8 to double*
113 ; CHECK-NEXT: %24 = load i64, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @"struct.C#3#14#13#13", i32 0, i32 3)
114 ; CHECK-NEXT: %25 = add i64 %24, 1
115 ; CHECK-NEXT: store i64 %25, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @"struct.C#3#14#13#13", i32 0, i32 3)
116 ; CHECK-NEXT: %arrayidx10 = getelementptr inbounds [2 x %struct.C], [2 x %struct.C]* %c, i64 0, i64 0
117 ; CHECK-NEXT: %26 = load i64, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @"struct.C#3#14#13#13", i32 0, i32 2)
118 ; CHECK-NEXT: %27 = add i64 %26, 1
119 ; CHECK-NEXT: store i64 %27, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @"struct.C#3#14#13#13", i32 0, i32 2)
120 ; CHECK-NEXT: %c11 = getelementptr inbounds %struct.C, %struct.C* %arrayidx10, i32 0, i32 2
121 ; CHECK-NEXT: %arrayidx12 = getelementptr inbounds [10 x i8], [10 x i8]* %c11, i64 0, i64 2
122 ; CHECK-NEXT: %k1 = load %struct.A*, %struct.A** %k, align 8
123 ; CHECK-NEXT: %arrayidx13 = getelementptr inbounds %struct.A, %struct.A* %k1, i64 0
124 ; CHECK-NEXT: ret i32 0
125
126 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
127 ; Top-level:
128
129 ; CHECK: define internal void @esan.module_ctor()
130 ; CHECK: call void @__esan_init(i32 1, i8* bitcast ({ i8*, i32, { i8*, i32, i32, i32*, i32*, i8**, i64*, i64* }* }* @7 to i8*))
131 ; CHECK: define internal void @esan.module_dtor()
132 ; CHECK: call void @__esan_exit(i8* bitcast ({ i8*, i32, { i8*, i32, i32, i32*, i32*, i8**, i64*, i64* }* }* @7 to i8*))