|
1156 | 1156 | // CHECK-REALTIME-UBSAN: error: invalid argument '-fsanitize=realtime' not allowed with '-fsanitize=undefined'
|
1157 | 1157 |
|
1158 | 1158 |
|
1159 |
| -// * Test -fno-sanitize-top-hot * |
| 1159 | +// * Test -fsanitize-skip-hot-cutoff * |
1160 | 1160 |
|
1161 |
| -// -fno-sanitize-top-hot=undefined=0.5 |
1162 |
| -// 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 |
1163 |
| -// 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}"}} |
| 1161 | +// -fsanitize-skip-hot-cutoff=undefined=0.5 |
| 1162 | +// RUN: %clang -Werror --target=x86_64-linux-gnu -fsanitize=undefined -fsanitize-skip-hot-cutoff=undefined=0.5 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SKIP-HOT-CUTOFF1 |
| 1163 | +// CHECK-SKIP-HOT-CUTOFF1: "-fsanitize-skip-hot-cutoff={{((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}"}} |
1164 | 1164 |
|
1165 | 1165 | // No-op: no sanitizers are specified
|
1166 |
| -// 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 |
1167 |
| -// CHECK-TOP-HOT2-NOT: "-fsanitize" |
1168 |
| -// CHECK-TOP-HOT2-NOT: "-fno-sanitize-top-hot" |
| 1166 | +// RUN: %clang -Werror --target=x86_64-linux-gnu -fsanitize-skip-hot-cutoff=undefined=0.5 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SKIP-HOT-CUTOFF2 |
| 1167 | +// CHECK-SKIP-HOT-CUTOFF2-NOT: "-fsanitize" |
| 1168 | +// CHECK-SKIP-HOT-CUTOFF2-NOT: "-fsanitize-skip-hot-cutoff" |
1169 | 1169 |
|
1170 | 1170 | // Enable undefined, then cancel out integer using a cutoff of 0.0
|
1171 |
| -// 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 |
1172 |
| -// 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}"}} |
| 1171 | +// RUN: %clang -Werror --target=x86_64-linux-gnu -fsanitize=undefined -fsanitize-skip-hot-cutoff=undefined=0.5,integer=0.0 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SKIP-HOT-CUTOFF3 |
| 1172 | +// CHECK-SKIP-HOT-CUTOFF3: "-fsanitize-skip-hot-cutoff={{((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}"}} |
1173 | 1173 |
|
1174 | 1174 | // Enable undefined, then cancel out integer using a cutoff of 0.0, then re-enable signed-integer-overflow
|
1175 |
| -// 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 |
1176 |
| -// 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.[57]0*,?){16}"}} |
| 1175 | +// RUN: %clang -Werror --target=x86_64-linux-gnu -fsanitize=undefined -fsanitize-skip-hot-cutoff=undefined=0.5,integer=0.0,signed-integer-overflow=0.7 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SKIP-HOT-CUTOFF4 |
| 1176 | +// CHECK-SKIP-HOT-CUTOFF4: "-fsanitize-skip-hot-cutoff={{((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.[57]0*,?){16}"}} |
1177 | 1177 |
|
1178 |
| -// Check that -fno-sanitize-top-hot=undefined=0.4 does not widen the set of -fsanitize=integer checks. |
1179 |
| -// RUN: %clang -Werror --target=x86_64-linux-gnu -fsanitize=integer -fno-sanitize-top-hot=undefined=0.4 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TOP-HOT5 |
1180 |
| -// CHECK-TOP-HOT5: "-fno-sanitize-top-hot={{((integer-divide-by-zero|shift-base|shift-exponent|signed-integer-overflow)=0.40*,?){4}"}} |
| 1178 | +// Check that -fsanitize-skip-hot-cutoff=undefined=0.4 does not widen the set of -fsanitize=integer checks. |
| 1179 | +// RUN: %clang -Werror --target=x86_64-linux-gnu -fsanitize=integer -fsanitize-skip-hot-cutoff=undefined=0.4 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SKIP-HOT-CUTOFF5 |
| 1180 | +// CHECK-SKIP-HOT-CUTOFF5: "-fsanitize-skip-hot-cutoff={{((integer-divide-by-zero|shift-base|shift-exponent|signed-integer-overflow)=0.40*,?){4}"}} |
1181 | 1181 |
|
1182 | 1182 | // No-op: it's allowed for the user to specify a cutoff of 0.0, though the argument is not passed along by the driver.
|
1183 |
| -// RUN: %clang -Werror --target=x86_64-linux-gnu -fsanitize=undefined -fno-sanitize-top-hot=undefined=0.0 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TOP-HOT6 |
1184 |
| -// CHECK-TOP-HOT6: "-fsanitize={{((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),?){19}"}} |
1185 |
| -// CHECK-TOP-HOT6-NOT: "-fno-sanitize-top-hot" |
| 1183 | +// RUN: %clang -Werror --target=x86_64-linux-gnu -fsanitize=undefined -fsanitize-skip-hot-cutoff=undefined=0.0 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SKIP-HOT-CUTOFF6 |
| 1184 | +// CHECK-SKIP-HOT-CUTOFF6: "-fsanitize={{((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),?){19}"}} |
| 1185 | +// CHECK-SKIP-HOT-CUTOFF6-NOT: "-fsanitize-skip-hot-cutoff" |
1186 | 1186 |
|
1187 | 1187 | // Invalid: bad sanitizer
|
1188 |
| -// RUN: not %clang --target=x86_64-linux-gnu -fno-sanitize-top-hot=pot=0.0 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TOP-HOT7 |
1189 |
| -// CHECK-TOP-HOT7: unsupported argument 'pot=0.0' to option '-fno-sanitize-top-hot=' |
| 1188 | +// RUN: not %clang --target=x86_64-linux-gnu -fsanitize-skip-hot-cutoff=pot=0.0 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SKIP-HOT-CUTOFF7 |
| 1189 | +// CHECK-SKIP-HOT-CUTOFF7: unsupported argument 'pot=0.0' to option '-fsanitize-skip-hot-cutoff=' |
1190 | 1190 |
|
1191 | 1191 | // Invalid: bad cutoff
|
1192 |
| -// RUN: not %clang --target=x86_64-linux-gnu -fno-sanitize-top-hot=undefined=xyzzy %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TOP-HOT8 |
1193 |
| -// CHECK-TOP-HOT8: unsupported argument 'undefined=xyzzy' to option '-fno-sanitize-top-hot=' |
| 1192 | +// RUN: not %clang --target=x86_64-linux-gnu -fsanitize-skip-hot-cutoff=undefined=xyzzy %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SKIP-HOT-CUTOFF8 |
| 1193 | +// CHECK-SKIP-HOT-CUTOFF8: unsupported argument 'undefined=xyzzy' to option '-fsanitize-skip-hot-cutoff=' |
1194 | 1194 |
|
1195 | 1195 | // Invalid: -fno-sanitize-top without parameters
|
1196 |
| -// RUN: not %clang --target=x86_64-linux-gnu -fno-sanitize-top-hot %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TOP-HOT9 |
1197 |
| -// CHECK-TOP-HOT9: unknown argument: '-fno-sanitize-top-hot' |
| 1196 | +// RUN: not %clang --target=x86_64-linux-gnu -fsanitize-skip-hot-cutoff %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SKIP-HOT-CUTOFF9 |
| 1197 | +// CHECK-SKIP-HOT-CUTOFF9: unknown argument: '-fsanitize-skip-hot-cutoff' |
1198 | 1198 |
|
1199 | 1199 | // Invalid: -fno-sanitize-top=undefined without cutoff
|
1200 |
| -// RUN: not %clang --target=x86_64-linux-gnu -fno-sanitize-top-hot=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TOP-HOT10 |
1201 |
| -// CHECK-TOP-HOT10: unsupported argument 'undefined' to option '-fno-sanitize-top-hot=' |
| 1200 | +// RUN: not %clang --target=x86_64-linux-gnu -fsanitize-skip-hot-cutoff=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SKIP-HOT-CUTOFF10 |
| 1201 | +// CHECK-SKIP-HOT-CUTOFF10: unsupported argument 'undefined' to option '-fsanitize-skip-hot-cutoff=' |
1202 | 1202 |
|
1203 | 1203 | // Invalid: -fno-sanitize-top=undefined= without cutoff
|
1204 |
| -// RUN: not %clang --target=x86_64-linux-gnu -fno-sanitize-top-hot=undefined= %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TOP-HOT11 |
1205 |
| -// CHECK-TOP-HOT11: unsupported argument 'undefined=' to option '-fno-sanitize-top-hot=' |
| 1204 | +// RUN: not %clang --target=x86_64-linux-gnu -fsanitize-skip-hot-cutoff=undefined= %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SKIP-HOT-CUTOFF11 |
| 1205 | +// CHECK-SKIP-HOT-CUTOFF11: unsupported argument 'undefined=' to option '-fsanitize-skip-hot-cutoff=' |
1206 | 1206 |
|
1207 | 1207 | // No-op: -fno-sanitize-top= without parameters is unusual but valid
|
1208 |
| -// RUN: %clang -Werror --target=x86_64-linux-gnu -fno-sanitize-top-hot= %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TOP-HOT12 |
1209 |
| -// CHECK-TOP-HOT12-NOT: "-fno-sanitize-top-hot" |
| 1208 | +// RUN: %clang -Werror --target=x86_64-linux-gnu -fsanitize-skip-hot-cutoff= %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SKIP-HOT-CUTOFF12 |
| 1209 | +// CHECK-SKIP-HOT-CUTOFF12-NOT: "-fsanitize-skip-hot-cutoff" |
0 commit comments