llvm.org GIT mirror llvm / 7569609
[sanitizer-coverage] ensure minimal alignment for coverage counters and guards git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309610 91177308-0d34-0410-b5e6-96231b3b80d8 Kostya Serebryany 2 years ago
3 changed file(s) with 4 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
486486 if (auto Comdat = F.getComdat())
487487 Array->setComdat(Comdat);
488488 Array->setSection(getSectionName(Section));
489 Array->setAlignment(Ty->isPointerTy() ? DL->getPointerSize()
490 : Ty->getPrimitiveSizeInBits() / 8);
489491 return Array;
490492 }
491493
504506 FunctionPCsArray->setInitializer(
505507 ConstantArray::get(ArrayType::get(Int8PtrTy, N), PCs));
506508 FunctionPCsArray->setConstant(true);
507 FunctionPCsArray->setAlignment(DL->getPointerSize());
508509 }
509510
510511 void SanitizerCoverageModule::CreateFunctionLocalArrays(
44 target triple = "x86_64-unknown-linux-gnu"
55 define void @foo() {
66 entry:
7 ; CHECK: section "__sancov_cntrs", align 1
78 ; CHECK: %0 = load i8, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @__sancov_gen_, i64 0, i64 0), !nosanitize
89 ; CHECK: %1 = add i8 %0, 1
910 ; CHECK: store i8 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @__sancov_gen_, i64 0, i64 0), !nosanitize
2525 ; CHECK_PC: ret void
2626 ; CHECK_PC-NOT: call void @__sanitizer_cov_module_init
2727
28 ; CHECK_PC_GUARD: section "__sancov_guards", align 4
2829 ; CHECK_PC_GUARD-LABEL: define void @foo
2930 ; CHECK_PC_GUARD: call void @__sanitizer_cov_trace_pc_guard
3031 ; CHECK_PC_GUARD: call void @__sanitizer_cov_trace_pc_guard