[PATCH] D156821: [CodeGen] [ubsan] Respect integer overflow handling in abs builtin

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 18 15:21:35 PDT 2023


MaskRay accepted this revision.
MaskRay added inline comments.
This revision is now accepted and ready to land.


================
Comment at: compiler-rt/test/ubsan/TestCases/Misc/abs.cpp:11
+int main() {
+  // ABORT: abs.cpp:[[@LINE+3]]:17: runtime error: negation of -{{[0-9]+}} cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
+  // RECOVER: abs.cpp:[[@LINE+2]]:17: runtime error: negation of -{{[0-9]+}} cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
----------------
FYI: `[[@LINE+3]]` is deprecated lit syntax https://llvm.org/docs/CommandGuide/FileCheck.html#filecheck-pseudo-numeric-variables. New code should use `[[#@LINE+3]]`

`{{[0-9]+}}` can be simplified as `[[#]]`


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156821/new/

https://reviews.llvm.org/D156821



More information about the cfe-commits mailing list