From ffad7727a821e44260f8d08814ab33e54ae46aaf Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Wed, 5 Nov 2025 10:47:04 -0800 Subject: [PATCH] [BoundsSafety] Unbreak CodeGen tests likely broken by new `nocreateundeforpoison` attribute https://github.com/llvm/llvm-project/pull/164809 adds a new attribute on various intrinsics including `llvm.sadd.with.overflow.i32` which is used in the two test cases. This patch adds the missing attributes Matching the attributes in this test is kind of silly because there's no corresponding use of `#ATTR1` in the test. If this continues to be a problem we should probably just manually remove the lines that `update_cc_test_checks.py` added. --- .../CodeGen/soft-traps/call_with_code_with_ubsan.c | 8 ++++---- .../CodeGen/soft-traps/call_with_str_with_ubsan.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/clang/test/BoundsSafety/CodeGen/soft-traps/call_with_code_with_ubsan.c b/clang/test/BoundsSafety/CodeGen/soft-traps/call_with_code_with_ubsan.c index 398e1c66f9869..f00986b8c78f5 100644 --- a/clang/test/BoundsSafety/CodeGen/soft-traps/call_with_code_with_ubsan.c +++ b/clang/test/BoundsSafety/CodeGen/soft-traps/call_with_code_with_ubsan.c @@ -264,26 +264,26 @@ int read(int* __bidi_indexable ptr, int idx, int other) { //. // UNOPT: attributes #[[ATTR0]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" } -// UNOPT: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } +// UNOPT: attributes #[[ATTR1:[0-9]+]] = { nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) } // UNOPT: attributes #[[ATTR2:[0-9]+]] = { cold noreturn nounwind memory(inaccessiblemem: write) } // UNOPT: attributes #[[ATTR3:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // UNOPT: attributes #[[ATTR4]] = { nomerge noreturn nounwind } // UNOPT: attributes #[[ATTR5]] = { nounwind } //. // UNOPT-TF: attributes #[[ATTR0]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" } -// UNOPT-TF: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } +// UNOPT-TF: attributes #[[ATTR1:[0-9]+]] = { nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) } // UNOPT-TF: attributes #[[ATTR2:[0-9]+]] = { cold noreturn nounwind memory(inaccessiblemem: write) } // UNOPT-TF: attributes #[[ATTR3:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // UNOPT-TF: attributes #[[ATTR4]] = { nomerge noreturn nounwind "trap-func-name"="ubsan_handler" } // UNOPT-TF: attributes #[[ATTR5]] = { nounwind } //. // UNOPT-TFR: attributes #[[ATTR0]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" } -// UNOPT-TFR: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } +// UNOPT-TFR: attributes #[[ATTR1:[0-9]+]] = { nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) } // UNOPT-TFR: attributes #[[ATTR2:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // UNOPT-TFR: attributes #[[ATTR3]] = { nounwind } //. // OPT: attributes #[[ATTR0]] = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" } -// OPT: attributes #[[ATTR1:[0-9]+]] = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } +// OPT: attributes #[[ATTR1:[0-9]+]] = { mustprogress nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) } // OPT: attributes #[[ATTR2:[0-9]+]] = { cold noreturn nounwind memory(inaccessiblemem: write) } // OPT: attributes #[[ATTR3]] = { nomerge noreturn nounwind } // OPT: attributes #[[ATTR4]] = { nounwind } diff --git a/clang/test/BoundsSafety/CodeGen/soft-traps/call_with_str_with_ubsan.c b/clang/test/BoundsSafety/CodeGen/soft-traps/call_with_str_with_ubsan.c index a9bb7910053e1..287de629013e8 100644 --- a/clang/test/BoundsSafety/CodeGen/soft-traps/call_with_str_with_ubsan.c +++ b/clang/test/BoundsSafety/CodeGen/soft-traps/call_with_str_with_ubsan.c @@ -700,7 +700,7 @@ int read_cb(int*__counted_by(count) ptr, int count, int other) { } //. // UNOPT: attributes #[[ATTR0]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" } -// UNOPT: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } +// UNOPT: attributes #[[ATTR1:[0-9]+]] = { nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) } // UNOPT: attributes #[[ATTR2:[0-9]+]] = { cold noreturn nounwind memory(inaccessiblemem: write) } // UNOPT: attributes #[[ATTR3:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // UNOPT: attributes #[[ATTR4:[0-9]+]] = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" } @@ -708,7 +708,7 @@ int read_cb(int*__counted_by(count) ptr, int count, int other) { // UNOPT: attributes #[[ATTR6]] = { nounwind } //. // UNOPT-TF: attributes #[[ATTR0]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" } -// UNOPT-TF: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } +// UNOPT-TF: attributes #[[ATTR1:[0-9]+]] = { nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) } // UNOPT-TF: attributes #[[ATTR2:[0-9]+]] = { cold noreturn nounwind memory(inaccessiblemem: write) } // UNOPT-TF: attributes #[[ATTR3:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // UNOPT-TF: attributes #[[ATTR4:[0-9]+]] = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" } @@ -717,14 +717,14 @@ int read_cb(int*__counted_by(count) ptr, int count, int other) { // UNOPT-TF: attributes #[[ATTR7]] = { "trap-func-name"="ubsan_handler" } //. // UNOPT-TFR: attributes #[[ATTR0]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" } -// UNOPT-TFR: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } +// UNOPT-TFR: attributes #[[ATTR1:[0-9]+]] = { nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) } // UNOPT-TFR: attributes #[[ATTR2:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // UNOPT-TFR: attributes #[[ATTR3:[0-9]+]] = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" } // UNOPT-TFR: attributes #[[ATTR4]] = { nounwind } // UNOPT-TFR: attributes #[[ATTR5]] = { "trap-func-name"="ubsan_handler" } //. // OPT: attributes #[[ATTR0]] = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" } -// OPT: attributes #[[ATTR1:[0-9]+]] = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } +// OPT: attributes #[[ATTR1:[0-9]+]] = { mustprogress nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) } // OPT: attributes #[[ATTR2:[0-9]+]] = { cold noreturn nounwind memory(inaccessiblemem: write) } // OPT: attributes #[[ATTR3:[0-9]+]] = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" } // OPT: attributes #[[ATTR4]] = { nomerge noreturn nounwind }