Skip to content

Commit bc4842f

Browse files
committed
Make -fsanitize-debug-trap-reasons= a parameterized flag that takes
either `none`, `basic`, or `detailed`. The old boolean flags are included for compatibility and are aliases of the new flag. The `basic` mode is the behavior that existed before this patch, and `detailed` is the newer more expressive trap reasons.
1 parent 6c78086 commit bc4842f

File tree

12 files changed

+195
-44
lines changed

12 files changed

+195
-44
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,22 @@ Non-comprehensive list of changes in this release
141141

142142
- Added ``__builtin_elementwise_minnumnum`` and ``__builtin_elementwise_maxnumnum``.
143143

144-
- Trapping UBSan (e.g. ``-fsanitize-trap=undefined``) now emits a string describing the reason for
145-
trapping into the generated debug info. This feature allows debuggers (e.g. LLDB) to display
146-
the reason for trapping if the trap is reached. The string is currently encoded in the debug
147-
info as an artificial frame that claims to be inlined at the trap location. The function used
148-
for the artificial frame is an artificial function whose name encodes the reason for trapping.
149-
The encoding used is currently the same as ``__builtin_verbose_trap`` but might change in the future.
150-
This feature is enabled by default but can be disabled by compiling with
151-
``-fno-sanitize-annotate-debug-info-traps``.
144+
- Trapping UBSan (e.g. ``-fsanitize-trap=undefined``) now emits a string
145+
describing the reason for trapping into the generated debug info. This feature
146+
allows debuggers (e.g. LLDB) to display the reason for trapping if the trap is
147+
reached. The string is currently encoded in the debug info as an artificial
148+
frame that claims to be inlined at the trap location. The function used for
149+
the artificial frame is an artificial function whose name encodes the reason
150+
for trapping. The encoding used is currently the same as
151+
``__builtin_verbose_trap`` but might change in the future. This feature is
152+
enabled by default but can be disabled by compiling with
153+
``-fno-sanitize-debug-trap-reasons``. The feature has a ``basic`` and
154+
``detailed`` mode (the default). The ``basic`` mode emits a hard-coded string
155+
per trap kind (e.g. integer overflow) and the ``detailed`` mode emits a more
156+
descriptive string describing each individual trap. The ``detailed`` mode
157+
produces larger debug info than ``basic`` but is more helpful for debugging.
158+
The ``-fsanitize-debug-trap-reasons=`` flag can be used to switch between the
159+
different modes.
152160

153161
- ``__builtin_elementwise_max`` and ``__builtin_elementwise_min`` functions for integer types can
154162
now be used in constant expressions.
@@ -185,7 +193,9 @@ Non-comprehensive list of changes in this release
185193

186194
New Compiler Flags
187195
------------------
188-
- New option ``-fno-sanitize-annotate-debug-info-traps`` added to disable emitting trap reasons into the debug info when compiling with trapping UBSan (e.g. ``-fsanitize-trap=undefined``).
196+
- New option ``-fno-sanitize-debug-trap-reasons`` added to disable emitting trap reasons into the debug info when compiling with trapping UBSan (e.g. ``-fsanitize-trap=undefined``).
197+
- New option ``-fsanitize-debug-trap-reasons=`` added to control emitting trap reasons into the debug info when compiling with trapping UBSan (e.g. ``-fsanitize-trap=undefined``).
198+
189199

190200
Lanai Support
191201
^^^^^^^^^^^^^^

clang/include/clang/Basic/CodeGenOptions.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ CODEGENOPT(SanitizeBinaryMetadataAtomics, 1, 0, Benign) ///< Emit PCs for atomic
307307
CODEGENOPT(SanitizeBinaryMetadataUAR, 1, 0, Benign) ///< Emit PCs for start of functions
308308
///< that are subject for use-after-return checking.
309309
CODEGENOPT(SanitizeStats , 1, 0, Benign) ///< Collect statistics for sanitizers.
310-
CODEGENOPT(SanitizeDebugTrapReasons, 1, 1 , Benign) ///< Enable UBSan trapping messages
310+
ENUM_CODEGENOPT(SanitizeDebugTrapReasons, SanitizeDebugTrapReasonKind, 2, SanitizeDebugTrapReasonKind::Detailed, Benign) ///< Control how "trap reasons" are emitted in debug info
311311
CODEGENOPT(SimplifyLibCalls , 1, 1, Benign) ///< Set when -fbuiltin is enabled.
312312
CODEGENOPT(SoftFloat , 1, 0, Benign) ///< -soft-float.
313313
CODEGENOPT(SpeculativeLoadHardening, 1, 0, Benign) ///< Enable speculative load hardening.

clang/include/clang/Basic/CodeGenOptions.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,16 @@ class CodeGenOptions : public CodeGenOptionsBase {
198198
Forced,
199199
};
200200

201+
enum SanitizeDebugTrapReasonKind {
202+
None, ///< Trap Messages are omitted. This offers the smallest debug info
203+
///< size but at the cost of making traps hard to debug.
204+
Basic, ///< Trap Message is fixed per SanitizerKind. Produces smaller debug
205+
///< info than `Detailed` but is not as helpful for debugging.
206+
Detailed, ///< Trap Message includes more context (e.g. the expression being
207+
///< overflowed). This is more helpful for debugging but produces
208+
///< larger debug info than `Basic`.
209+
};
210+
201211
/// The code model to use (-mcmodel).
202212
std::string CodeModel;
203213

clang/include/clang/Driver/Options.td

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2612,16 +2612,27 @@ def fsanitize_undefined_trap_on_error
26122612
def fno_sanitize_undefined_trap_on_error
26132613
: Flag<["-"], "fno-sanitize-undefined-trap-on-error">, Group<f_clang_Group>,
26142614
Alias<fno_sanitize_trap_EQ>, AliasArgs<["undefined"]>;
2615-
defm sanitize_debug_trap_reasons
2616-
: BoolFOption<
2617-
"sanitize-debug-trap-reasons",
2618-
CodeGenOpts<"SanitizeDebugTrapReasons">, DefaultTrue,
2619-
PosFlag<SetTrue, [], [ClangOption, CC1Option],
2620-
"Annotate trap blocks in debug info with UBSan trap reasons">,
2621-
NegFlag<SetFalse, [], [ClangOption, CC1Option],
2622-
"Do not annotate trap blocks in debug info with UBSan trap "
2623-
"reasons">>;
2624-
2615+
def fsanitize_debug_trap_reasons_EQ
2616+
: Joined<["-"], "fsanitize-debug-trap-reasons=">, Group<f_Group>,
2617+
Visibility<[ClangOption, CC1Option]>,
2618+
HelpText<"Set how trap reasons are emitted. "
2619+
"`none` - Not emitted. This gives the smallest debug info; "
2620+
"`basic` - Emit a fixed trap message per check type. This increases the "
2621+
"debug info size but not as much as `detailed`; "
2622+
"`detailed` - Emit a more detailed trap message. This increases the "
2623+
"debug info size the most. Default is `detailed`.">,
2624+
Values<"none,basic,detailed">,
2625+
NormalizedValuesScope<"CodeGenOptions::SanitizeDebugTrapReasonKind">,
2626+
NormalizedValues<["None", "Basic", "Detailed"]>,
2627+
MarshallingInfoEnum<CodeGenOpts<"SanitizeDebugTrapReasons">, "Detailed">;
2628+
def fsanitize_debug_trap_reasons
2629+
: Flag<["-"], "fsanitize-debug-trap-reasons">, Group<f_clang_Group>,
2630+
Alias<fsanitize_debug_trap_reasons_EQ>, AliasArgs<["detailed"]>,
2631+
HelpText<"Alias for -fsanitize-debug-trap-reasons=detailed">;
2632+
def fno_sanitize_debug_trap_reasons
2633+
: Flag<["-"], "fno-sanitize-debug-trap-reasons">, Group<f_clang_Group>,
2634+
Alias<fsanitize_debug_trap_reasons_EQ>, AliasArgs<["none"]>,
2635+
HelpText<"Alias for -fsanitize-debug-trap-reasons=none">;
26252636
defm sanitize_minimal_runtime : BoolOption<"f", "sanitize-minimal-runtime",
26262637
CodeGenOpts<"SanitizeMinimalRuntime">, DefaultFalse,
26272638
PosFlag<SetTrue>,

clang/lib/CodeGen/CGExpr.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4146,7 +4146,10 @@ void CodeGenFunction::EmitTrapCheck(llvm::Value *Checked,
41464146
llvm::DILocation *TrapLocation = Builder.getCurrentDebugLocation();
41474147
llvm::StringRef TrapMessage;
41484148
llvm::StringRef TrapCategory;
4149-
if (TR && !TR->isEmpty()) {
4149+
auto DebugTrapReasonKind = CGM.getCodeGenOpts().getSanitizeDebugTrapReasons();
4150+
if (TR && !TR->isEmpty() &&
4151+
DebugTrapReasonKind ==
4152+
CodeGenOptions::SanitizeDebugTrapReasonKind::Detailed) {
41504153
TrapMessage = TR->getMessage();
41514154
TrapCategory = TR->getCategory();
41524155
} else {
@@ -4155,7 +4158,9 @@ void CodeGenFunction::EmitTrapCheck(llvm::Value *Checked,
41554158
}
41564159

41574160
if (getDebugInfo() && !TrapMessage.empty() &&
4158-
CGM.getCodeGenOpts().SanitizeDebugTrapReasons && TrapLocation) {
4161+
DebugTrapReasonKind !=
4162+
CodeGenOptions::SanitizeDebugTrapReasonKind::None &&
4163+
TrapLocation) {
41594164
TrapLocation = getDebugInfo()->CreateTrapFailureMessageFor(
41604165
TrapLocation, TrapCategory, TrapMessage);
41614166
}

clang/lib/Driver/SanitizerArgs.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,11 +1384,7 @@ void SanitizerArgs::addArgs(const ToolChain &TC, const llvm::opt::ArgList &Args,
13841384
CmdArgs.push_back(Args.MakeArgString("-fsanitize-annotate-debug-info=" +
13851385
toString(AnnotateDebugInfo)));
13861386

1387-
if (const Arg *A =
1388-
Args.getLastArg(options::OPT_fsanitize_debug_trap_reasons,
1389-
options::OPT_fno_sanitize_debug_trap_reasons)) {
1390-
CmdArgs.push_back(Args.MakeArgString(A->getAsString(Args)));
1391-
}
1387+
Args.AddLastArg(CmdArgs, options::OPT_fsanitize_debug_trap_reasons_EQ);
13921388

13931389
addSpecialCaseListOpt(Args, CmdArgs,
13941390
"-fsanitize-ignorelist=", UserIgnorelistFiles);

clang/test/DebugInfo/Generic/ubsan-trap-reason-add-overflow.c

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
// RUN: %clang_cc1 -triple arm64-apple-macosx14.0.0 -O0 -debug-info-kind=standalone -dwarf-version=5 \
22
// RUN: -fsanitize=signed-integer-overflow,unsigned-integer-overflow \
33
// RUN: -fsanitize-trap=signed-integer-overflow,unsigned-integer-overflow \
4-
// RUN: -emit-llvm %s -o - | FileCheck %s
4+
// RUN: -emit-llvm %s -o - | FileCheck --check-prefixes=CHECK,DETAILED %s
5+
6+
// RUN: %clang_cc1 -triple arm64-apple-macosx14.0.0 -O0 -debug-info-kind=standalone -dwarf-version=5 \
7+
// RUN: -fsanitize=signed-integer-overflow,unsigned-integer-overflow \
8+
// RUN: -fsanitize-trap=signed-integer-overflow,unsigned-integer-overflow \
9+
// RUN: -fsanitize-debug-trap-reasons=basic \
10+
// RUN: -emit-llvm %s -o - | FileCheck --check-prefixes=CHECK,BASIC %s
511

612
int sadd_overflow(int a, int b) { return a + b; }
713

@@ -13,9 +19,14 @@ unsigned add_overflow(unsigned c, unsigned d) { return c + d; }
1319
// CHECK-LABEL: @add_overflow
1420
// CHECK: call void @llvm.ubsantrap(i8 0) {{.*}}!dbg [[LOC:![0-9]+]]
1521

22+
// DETAILED: [[SLOC]] = !DILocation(line: 0, scope: [[SMSG:![0-9]+]], {{.+}})
23+
// DETAILED: [[SMSG]] = distinct !DISubprogram(name: "__clang_trap_msg$Undefined Behavior Sanitizer$signed integer addition overflow in 'a + b'"
24+
// DETAILED: [[LOC]] = !DILocation(line: 0, scope: [[MSG:![0-9]+]], {{.+}})
25+
// DETAILED: [[MSG]] = distinct !DISubprogram(name: "__clang_trap_msg$Undefined Behavior Sanitizer$unsigned integer addition overflow in 'c + d'"
26+
27+
// In "Basic" mode both the trap reason is shared by both functions.
28+
// BASIC: [[SLOC]] = !DILocation(line: 0, scope: [[MSG:![0-9]+]], {{.+}})
29+
// BASIC: [[MSG]] = distinct !DISubprogram(name: "__clang_trap_msg$Undefined Behavior Sanitizer$Integer addition overflowed"
30+
// BASIC: [[LOC]] = !DILocation(line: 0, scope: [[MSG:![0-9]+]], {{.+}})
1631

17-
// CHECK: [[SLOC]] = !DILocation(line: 0, scope: [[SMSG:![0-9]+]], {{.+}})
18-
// CHECK: [[SMSG]] = distinct !DISubprogram(name: "__clang_trap_msg$Undefined Behavior Sanitizer$signed integer addition overflow in 'a + b'"
1932

20-
// CHECK: [[LOC]] = !DILocation(line: 0, scope: [[MSG:![0-9]+]], {{.+}})
21-
// CHECK: [[MSG]] = distinct !DISubprogram(name: "__clang_trap_msg$Undefined Behavior Sanitizer$unsigned integer addition overflow in 'c + d'"

clang/test/DebugInfo/Generic/ubsan-trap-reason-flag.c

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,45 @@
22
// RUN: -fsanitize=signed-integer-overflow -fsanitize-trap=signed-integer-overflow -emit-llvm %s -o - \
33
// RUN: | FileCheck %s --check-prefix=ANNOTATE
44

5+
//==============================================================================
6+
// Detailed trap reasons
7+
//==============================================================================
8+
9+
// RUN: %clang_cc1 -triple arm64-apple-macosx14.0.0 -O0 -debug-info-kind=standalone -dwarf-version=5 \
10+
// RUN: -fsanitize=signed-integer-overflow -fsanitize-trap=signed-integer-overflow \
11+
// RUN: -fsanitize-debug-trap-reasons -emit-llvm %s -o - | FileCheck %s --check-prefixes=ANNOTATE,DETAILED
12+
13+
// RUN: %clang_cc1 -triple arm64-apple-macosx14.0.0 -O0 -debug-info-kind=standalone -dwarf-version=5 \
14+
// RUN: -fsanitize=signed-integer-overflow -fsanitize-trap=signed-integer-overflow \
15+
// RUN: -fsanitize-debug-trap-reasons=detailed -emit-llvm %s -o - | FileCheck %s --check-prefixes=ANNOTATE,DETAILED
16+
17+
//==============================================================================
18+
// Basic trap reasons
19+
//==============================================================================
20+
521
// RUN: %clang_cc1 -triple arm64-apple-macosx14.0.0 -O0 -debug-info-kind=standalone -dwarf-version=5 \
622
// RUN: -fsanitize=signed-integer-overflow -fsanitize-trap=signed-integer-overflow \
7-
// RUN: -fsanitize-debug-trap-reasons -emit-llvm %s -o - | FileCheck %s --check-prefix=ANNOTATE
23+
// RUN: -fsanitize-debug-trap-reasons=basic -emit-llvm %s -o - | FileCheck %s --check-prefixes=ANNOTATE,BASIC
24+
25+
//==============================================================================
26+
// No trap reasons
27+
//==============================================================================
828

929
// RUN: %clang_cc1 -triple arm64-apple-macosx14.0.0 -O0 -debug-info-kind=standalone -dwarf-version=5 \
1030
// RUN: -fsanitize=signed-integer-overflow -fsanitize-trap=signed-integer-overflow \
1131
// RUN: -fno-sanitize-debug-trap-reasons -emit-llvm %s -o - | FileCheck %s --check-prefix=NO-ANNOTATE
1232

33+
// RUN: %clang_cc1 -triple arm64-apple-macosx14.0.0 -O0 -debug-info-kind=standalone -dwarf-version=5 \
34+
// RUN: -fsanitize=signed-integer-overflow -fsanitize-trap=signed-integer-overflow \
35+
// RUN: -fsanitize-debug-trap-reasons=none -emit-llvm %s -o - | FileCheck %s --check-prefix=NO-ANNOTATE
36+
1337
int add_overflow(int a, int b) { return a + b; }
1438

1539
// ANNOTATE-LABEL: @add_overflow
1640
// ANNOTATE: call void @llvm.ubsantrap(i8 0) {{.*}}!dbg [[LOC:![0-9]+]]
1741
// ANNOTATE: [[LOC]] = !DILocation(line: 0, scope: [[MSG:![0-9]+]], {{.+}})
18-
// ANNOTATE: [[MSG]] = distinct !DISubprogram(name: "__clang_trap_msg$Undefined Behavior Sanitizer$signed integer addition overflow in 'a + b'"
42+
// DETAILED: [[MSG]] = distinct !DISubprogram(name: "__clang_trap_msg$Undefined Behavior Sanitizer$signed integer addition overflow in 'a + b'"
43+
// BASIC: [[MSG]] = distinct !DISubprogram(name: "__clang_trap_msg$Undefined Behavior Sanitizer$Integer addition overflowed"
1944

2045
// NO-ANNOTATE-LABEL: @add_overflow
2146
// NO-ANNOTATE: call void @llvm.ubsantrap(i8 0) {{.*}}!dbg [[LOC:![0-9]+]]
Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
// RUN: %clang_cc1 -triple arm64-apple-macosx14.0.0 -O0 -debug-info-kind=standalone -dwarf-version=5 \
22
// RUN: -fsanitize=signed-integer-overflow,unsigned-integer-overflow \
33
// RUN: -fsanitize-trap=signed-integer-overflow,unsigned-integer-overflow \
4-
// RUN: -emit-llvm %s -o - | FileCheck %s
4+
// RUN: -emit-llvm %s -o - | FileCheck --check-prefixes=CHECK,DETAILED %s
5+
6+
// RUN: %clang_cc1 -triple arm64-apple-macosx14.0.0 -O0 -debug-info-kind=standalone -dwarf-version=5 \
7+
// RUN: -fsanitize=signed-integer-overflow,unsigned-integer-overflow \
8+
// RUN: -fsanitize-trap=signed-integer-overflow,unsigned-integer-overflow \
9+
// RUN: -fsanitize-debug-trap-reasons=basic \
10+
// RUN: -emit-llvm %s -o - | FileCheck --check-prefixes=CHECK,BASIC %s
511

612
int smul_overflow(int a, int b) { return a * b; }
713

@@ -13,8 +19,12 @@ unsigned mul_overflow(unsigned c, unsigned d) { return c * d; }
1319
// CHECK-LABEL: @mul_overflow
1420
// CHECK: call void @llvm.ubsantrap(i8 12) {{.*}}!dbg [[LOC:![0-9]+]]
1521

16-
// CHECK: [[SLOC]] = !DILocation(line: 0, scope: [[SMSG:![0-9]+]], {{.+}})
17-
// CHECK: [[SMSG]] = distinct !DISubprogram(name: "__clang_trap_msg$Undefined Behavior Sanitizer$signed integer multiplication overflow in 'a * b'"
22+
// DETAILED: [[SLOC]] = !DILocation(line: 0, scope: [[SMSG:![0-9]+]], {{.+}})
23+
// DETAILED: [[SMSG]] = distinct !DISubprogram(name: "__clang_trap_msg$Undefined Behavior Sanitizer$signed integer multiplication overflow in 'a * b'"
24+
// DETAILED: [[LOC]] = !DILocation(line: 0, scope: [[MSG:![0-9]+]], {{.+}})
25+
// DETAILED: [[MSG]] = distinct !DISubprogram(name: "__clang_trap_msg$Undefined Behavior Sanitizer$unsigned integer multiplication overflow in 'c * d'"
1826

19-
// CHECK: [[LOC]] = !DILocation(line: 0, scope: [[MSG:![0-9]+]], {{.+}})
20-
// CHECK: [[MSG]] = distinct !DISubprogram(name: "__clang_trap_msg$Undefined Behavior Sanitizer$unsigned integer multiplication overflow in 'c * d'"
27+
// In "Basic" mode both the trap reason is shared by both functions.
28+
// BASIC: [[SLOC]] = !DILocation(line: 0, scope: [[MSG:![0-9]+]], {{.+}})
29+
// BASIC: [[MSG]] = distinct !DISubprogram(name: "__clang_trap_msg$Undefined Behavior Sanitizer$Integer multiplication overflowed"
30+
// BASIC: [[LOC]] = !DILocation(line: 0, scope: [[MSG:![0-9]+]], {{.+}})
Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
// RUN: %clang_cc1 -triple arm64-apple-macosx14.0.0 -O0 -debug-info-kind=standalone -dwarf-version=5 \
22
// RUN: -fsanitize=signed-integer-overflow,unsigned-integer-overflow \
33
// RUN: -fsanitize-trap=signed-integer-overflow,unsigned-integer-overflow \
4-
// RUN: -emit-llvm %s -o - | FileCheck %s
4+
// RUN: -emit-llvm %s -o - | FileCheck --check-prefixes=CHECK,DETAILED %s
5+
6+
// RUN: %clang_cc1 -triple arm64-apple-macosx14.0.0 -O0 -debug-info-kind=standalone -dwarf-version=5 \
7+
// RUN: -fsanitize=signed-integer-overflow,unsigned-integer-overflow \
8+
// RUN: -fsanitize-trap=signed-integer-overflow,unsigned-integer-overflow \
9+
// RUN: -fsanitize-debug-trap-reasons=basic \
10+
// RUN: -emit-llvm %s -o - | FileCheck --check-prefixes=CHECK,BASIC %s
511

612
int ssub_overflow(int a, int b) { return a - b; }
713

@@ -13,8 +19,12 @@ unsigned sub_overflow(unsigned c, unsigned d) { return c - d; }
1319
// CHECK-LABEL: @sub_overflow
1420
// CHECK: call void @llvm.ubsantrap(i8 21) {{.*}}!dbg [[LOC:![0-9]+]]
1521

16-
// CHECK: [[SLOC]] = !DILocation(line: 0, scope: [[SMSG:![0-9]+]], {{.+}})
17-
// CHECK: [[SMSG]] = distinct !DISubprogram(name: "__clang_trap_msg$Undefined Behavior Sanitizer$signed integer subtraction overflow in 'a - b'"
22+
// DETAILED: [[SLOC]] = !DILocation(line: 0, scope: [[SMSG:![0-9]+]], {{.+}})
23+
// DETAILED: [[SMSG]] = distinct !DISubprogram(name: "__clang_trap_msg$Undefined Behavior Sanitizer$signed integer subtraction overflow in 'a - b'"
24+
// DETAILED: [[LOC]] = !DILocation(line: 0, scope: [[MSG:![0-9]+]], {{.+}})
25+
// DETAILED: [[MSG]] = distinct !DISubprogram(name: "__clang_trap_msg$Undefined Behavior Sanitizer$unsigned integer subtraction overflow in 'c - d'"
1826

19-
// CHECK: [[LOC]] = !DILocation(line: 0, scope: [[MSG:![0-9]+]], {{.+}})
20-
// CHECK: [[MSG]] = distinct !DISubprogram(name: "__clang_trap_msg$Undefined Behavior Sanitizer$unsigned integer subtraction overflow in 'c - d'"
27+
// In "Basic" mode both the trap reason is shared by both functions.
28+
// BASIC: [[SLOC]] = !DILocation(line: 0, scope: [[MSG:![0-9]+]], {{.+}})
29+
// BASIC: [[MSG]] = distinct !DISubprogram(name: "__clang_trap_msg$Undefined Behavior Sanitizer$Integer subtraction overflowed"
30+
// BASIC: [[LOC]] = !DILocation(line: 0, scope: [[MSG:![0-9]+]], {{.+}})

0 commit comments

Comments
 (0)