================
@@ -1154,3 +1154,56 @@
 
 // RUN: not %clang --target=x86_64-linux-gnu -fsanitize=realtime,undefined  %s 
-### 2>&1 | FileCheck %s --check-prefix=CHECK-REALTIME-UBSAN
 // CHECK-REALTIME-UBSAN: error: invalid argument '-fsanitize=realtime' not 
allowed with '-fsanitize=undefined'
+
+
+// * Test -fno-sanitize-top-hot *
+
+// -fno-sanitize-top-hot=undefined=0.5
+// RUN: %clang -Werror --target=x86_64-linux-gnu -fsanitize=undefined 
-fno-sanitize-top-hot=undefined=0.5 %s -### 2>&1 | FileCheck %s 
--check-prefix=CHECK-TOP-HOT1
+// CHECK-TOP-HOT1: 
"-fno-sanitize-top-hot={{((signed-integer-overflow|integer-divide-by-zero|shift-base|shift-exponent|unreachable|return|vla-bound|alignment|null|pointer-overflow|float-cast-overflow|array-bounds|enum|bool|builtin|returns-nonnull-attribute|nonnull-attribute|function|vptr)=0.5(0*),?){19}"}}
+
+// No-op: no sanitizers are specified
+// RUN: %clang -Werror --target=x86_64-linux-gnu 
-fno-sanitize-top-hot=undefined=0.5 %s -### 2>&1 | FileCheck %s 
--check-prefix=CHECK-TOP-HOT2
+// CHECK-TOP-HOT2-NOT: "-fsanitize"
+// CHECK-TOP-HOT2-NOT: "-fno-sanitize-top-hot"
+
+// Enable undefined, then cancel out integer using a cutoff of 0.0
+// RUN: %clang -Werror --target=x86_64-linux-gnu -fsanitize=undefined 
-fno-sanitize-top-hot=undefined=0.5,integer=0.0 %s -### 2>&1 | FileCheck %s 
--check-prefix=CHECK-TOP-HOT3
+// CHECK-TOP-HOT3: 
"-fno-sanitize-top-hot={{((unreachable|return|vla-bound|alignment|null|pointer-overflow|float-cast-overflow|array-bounds|enum|bool|builtin|returns-nonnull-attribute|nonnull-attribute|function|vptr)=0.5(0*),?){15}"}}
+
+// Enable undefined, then cancel out integer using a cutoff of 0.0, then 
re-enable signed-integer-overflow
+// RUN: %clang -Werror --target=x86_64-linux-gnu -fsanitize=undefined 
-fno-sanitize-top-hot=undefined=0.5,integer=0.0,signed-integer-overflow=0.7 %s 
-### 2>&1 | FileCheck %s --check-prefix=CHECK-TOP-HOT4
+// CHECK-TOP-HOT4: 
"-fno-sanitize-top-hot={{((signed-integer-overflow|unreachable|return|vla-bound|alignment|null|pointer-overflow|float-cast-overflow|array-bounds|enum|bool|builtin|returns-nonnull-attribute|nonnull-attribute|function|vptr)=(0.5|0.49|0.7|0.69)([0-9]*),?){16}"}}
----------------
vitalybuka wrote:

`(0.5|0.49|0.7|0.69)([0-9]*)` -> `0.[4569]([0-9]*)`

https://github.com/llvm/llvm-project/pull/121619
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to