brintos

brintos / llvm-project-archived public Read only

0
0
Text · 815 B · 6d722c2 Raw
21 lines · c
1// This file tests that -fprofile-sample-use enables location tracking2// generation in the same way that -Rpass does. The sample profiler needs3// to associate line locations in the profile to the code, so it needs the4// frontend to emit source location annotations.5 6// RUN: %clang_cc1 %s -fprofile-sample-use=%S/Inputs/profile-sample-use-loc-tracking.prof -emit-llvm -o - 2>/dev/null | FileCheck %s7 8// -fprofile-sample-use should produce source location annotations, exclusively9// (just like -gmlt).10// CHECK: , !dbg !11// CHECK-NOT: DW_TAG_base_type12 13// The CU should be marked NoDebug (to prevent writing debug info to14// the final output).15// CHECK: !llvm.dbg.cu = !{![[CU:.*]]}16// CHECK: ![[CU]] = distinct !DICompileUnit({{.*}}emissionKind: NoDebug17 18int bar(int j) {19  return (j + j - 2) * (j - 2) * j;20}21