[compiler-rt] [compiler-rt][nsan] Add support for nan detection (PR #101531)

Alexander Shaposhnikov via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 11 07:23:39 PDT 2024


================
@@ -0,0 +1,53 @@
+// RUN: %clangxx_nsan -O0 -g -DSOFTMAX=softmax %s -o %t
+// RUN: NSAN_OPTIONS=check_nan=true,halt_on_error=0,log2_max_relative_error=19 %run %t 2>&1 | FileCheck %s
+
+// RUN: %clangxx_nsan -O0 -g -DSOFTMAX=softmax %s -o %t
+// RUN: NSAN_OPTIONS=check_nan=true,halt_on_error=0,log2_max_relative_error=19 %run %t 2>&1 | FileCheck %s
+
+// RUN: %clangxx_nsan -O0 -g -DSOFTMAX=stable_softmax %s -o %t
+// RUN: NSAN_OPTIONS=check_nan=true,halt_on_error=0,log2_max_relative_error=19 %run %t 2>&1 
+
+// RUN: %clangxx_nsan -O0 -g -DSOFTMAX=stable_softmax %s -o %t
----------------
alexander-shaposhnikov wrote:

i suspect the second invocation was meant for `halt_on_error=1`.
In this case we don't need to rebuild the binary, and if the exit code is nonzero you may want to use `not` (take a look at similar tests)

https://github.com/llvm/llvm-project/pull/101531


More information about the llvm-commits mailing list