Skip to content

Commit 1371773

Browse files
authored
Rollup merge of #114229 - workingjubilee:nest-sanitizer-dir, r=Mark-Simulacrum
Nest tests/codegen/sanitizer*.rs tests in sanitizer dir The sanitizer tests are the largest and most meticulously tested set of tests in tests/codegen. That's good! They all clearly belong to a subject and thus could go in a directory, but are not, instead being placed simply in tests/codegen. That's bad! Fix this by placing them in their own directory and renaming them to be less repetitive after that move. A few tests are brittle, and embed their filename in the test's checks. This is acceptable for the ones where it is used only two times, but one test embeds the test's mangled filename in the test *over 50 times*! This may have been one of the things discouraging anyone from moving it, and thus from moving the set. Fortunately, I have some knowledge of Itanium mangling (involuntarily), regex, and the FileCheck syntax. With a capturing variable, FileCheck allows us to now move this test around again without diffing it on ~50 lines, while still guaranteeing that the mangled substring is the same each time. This also clarifies why the substring is repeated a zillion times, instead of being cryptic. They don't call it mangling because the result is pretty and easy to understand, but now it is slightly easier! Yay descriptive variables!
2 parents 61c55e3 + 4d2957c commit 1371773

29 files changed

+54
-54
lines changed

tests/codegen/sanitizer-cfi-emit-type-checks-attr-no-sanitize.rs renamed to tests/codegen/sanitizer/cfi-emit-type-checks-attr-no-sanitize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#[no_sanitize(cfi)]
1010
pub fn foo(f: fn(i32) -> i32, arg: i32) -> i32 {
11-
// CHECK-LABEL: sanitizer_cfi_emit_type_checks_attr_no_sanitize::foo
11+
// CHECK-LABEL: cfi_emit_type_checks_attr_no_sanitize::foo
1212
// CHECK: Function Attrs: {{.*}}
1313
// CHECK-LABEL: define{{.*}}foo{{.*}}!type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}}
1414
// CHECK: start:

tests/codegen/sanitizer-cfi-emit-type-metadata-id-itanium-cxx-abi.rs renamed to tests/codegen/sanitizer/cfi-emit-type-metadata-id-itanium-cxx-abi.rs

Lines changed: 48 additions & 48 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)