Skip to content

Commit 7ac30b4

Browse files
committed
[BoundsSafety] Unbreak CodeGen tests likely broken by new nocreateundeforpoison attribute
llvm#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.
1 parent 90b03e5 commit 7ac30b4

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

clang/test/BoundsSafety/CodeGen/soft-traps/call_with_code_with_ubsan.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,26 +264,26 @@ int read(int* __bidi_indexable ptr, int idx, int other) {
264264

265265
//.
266266
// UNOPT: attributes #[[ATTR0]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
267-
// UNOPT: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
267+
// UNOPT: attributes #[[ATTR1:[0-9]+]] = { nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) }
268268
// UNOPT: attributes #[[ATTR2:[0-9]+]] = { cold noreturn nounwind memory(inaccessiblemem: write) }
269269
// UNOPT: attributes #[[ATTR3:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
270270
// UNOPT: attributes #[[ATTR4]] = { nomerge noreturn nounwind }
271271
// UNOPT: attributes #[[ATTR5]] = { nounwind }
272272
//.
273273
// UNOPT-TF: attributes #[[ATTR0]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
274-
// UNOPT-TF: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
274+
// UNOPT-TF: attributes #[[ATTR1:[0-9]+]] = { nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) }
275275
// UNOPT-TF: attributes #[[ATTR2:[0-9]+]] = { cold noreturn nounwind memory(inaccessiblemem: write) }
276276
// UNOPT-TF: attributes #[[ATTR3:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
277277
// UNOPT-TF: attributes #[[ATTR4]] = { nomerge noreturn nounwind "trap-func-name"="ubsan_handler" }
278278
// UNOPT-TF: attributes #[[ATTR5]] = { nounwind }
279279
//.
280280
// UNOPT-TFR: attributes #[[ATTR0]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
281-
// UNOPT-TFR: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
281+
// UNOPT-TFR: attributes #[[ATTR1:[0-9]+]] = { nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) }
282282
// UNOPT-TFR: attributes #[[ATTR2:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
283283
// UNOPT-TFR: attributes #[[ATTR3]] = { nounwind }
284284
//.
285285
// OPT: attributes #[[ATTR0]] = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
286-
// OPT: attributes #[[ATTR1:[0-9]+]] = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
286+
// OPT: attributes #[[ATTR1:[0-9]+]] = { mustprogress nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) }
287287
// OPT: attributes #[[ATTR2:[0-9]+]] = { cold noreturn nounwind memory(inaccessiblemem: write) }
288288
// OPT: attributes #[[ATTR3]] = { nomerge noreturn nounwind }
289289
// OPT: attributes #[[ATTR4]] = { nounwind }

clang/test/BoundsSafety/CodeGen/soft-traps/call_with_str_with_ubsan.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -700,15 +700,15 @@ int read_cb(int*__counted_by(count) ptr, int count, int other) {
700700
}
701701
//.
702702
// UNOPT: attributes #[[ATTR0]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
703-
// UNOPT: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
703+
// UNOPT: attributes #[[ATTR1:[0-9]+]] = { nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) }
704704
// UNOPT: attributes #[[ATTR2:[0-9]+]] = { cold noreturn nounwind memory(inaccessiblemem: write) }
705705
// UNOPT: attributes #[[ATTR3:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
706706
// UNOPT: attributes #[[ATTR4:[0-9]+]] = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
707707
// UNOPT: attributes #[[ATTR5]] = { nomerge noreturn nounwind }
708708
// UNOPT: attributes #[[ATTR6]] = { nounwind }
709709
//.
710710
// UNOPT-TF: attributes #[[ATTR0]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
711-
// UNOPT-TF: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
711+
// UNOPT-TF: attributes #[[ATTR1:[0-9]+]] = { nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) }
712712
// UNOPT-TF: attributes #[[ATTR2:[0-9]+]] = { cold noreturn nounwind memory(inaccessiblemem: write) }
713713
// UNOPT-TF: attributes #[[ATTR3:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
714714
// 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) {
717717
// UNOPT-TF: attributes #[[ATTR7]] = { "trap-func-name"="ubsan_handler" }
718718
//.
719719
// UNOPT-TFR: attributes #[[ATTR0]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
720-
// UNOPT-TFR: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
720+
// UNOPT-TFR: attributes #[[ATTR1:[0-9]+]] = { nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) }
721721
// UNOPT-TFR: attributes #[[ATTR2:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
722722
// UNOPT-TFR: attributes #[[ATTR3:[0-9]+]] = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
723723
// UNOPT-TFR: attributes #[[ATTR4]] = { nounwind }
724724
// UNOPT-TFR: attributes #[[ATTR5]] = { "trap-func-name"="ubsan_handler" }
725725
//.
726726
// OPT: attributes #[[ATTR0]] = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
727-
// OPT: attributes #[[ATTR1:[0-9]+]] = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
727+
// OPT: attributes #[[ATTR1:[0-9]+]] = { mustprogress nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) }
728728
// OPT: attributes #[[ATTR2:[0-9]+]] = { cold noreturn nounwind memory(inaccessiblemem: write) }
729729
// OPT: attributes #[[ATTR3:[0-9]+]] = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
730730
// OPT: attributes #[[ATTR4]] = { nomerge noreturn nounwind }

0 commit comments

Comments
 (0)