2
2
// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -fsanitize=integer-divide-by-zero -O3 %s -o - -fsanitize-recover=integer-divide-by-zero | FileCheck %s --check-prefixes=RECOVER
3
3
// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -fsanitize=integer-divide-by-zero -O3 %s -o - | FileCheck %s --check-prefixes=ABORT
4
4
5
- // RECOVER: Function Attrs: mustprogress nounwind willreturn memory(read, argmem: readwrite, inaccessiblemem: readwrite)
5
+ // RECOVER: Function Attrs: mustprogress nounwind memory(read, argmem: readwrite, inaccessiblemem: readwrite)
6
6
// RECOVER-LABEL: define dso_local noundef range(i32 -32768, 32768) i32 @_Z4testRiRs(
7
7
// RECOVER-SAME: ptr noundef nonnull align 4 captures(none) dereferenceable(4) [[A:%.*]], ptr noundef nonnull readonly align 2 captures(none) dereferenceable(2) [[C:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
8
8
// RECOVER-NEXT: [[ENTRY:.*:]]
@@ -44,10 +44,11 @@ int test(int &a, short &c) {
44
44
}
45
45
46
46
// Make sure that we don't eliminate the call to ubsan handler.
47
- // RECOVER: Function Attrs: mustprogress nofree norecurse noreturn nosync nounwind willreturn memory(none)
47
+ // RECOVER: Function Attrs: mustprogress noreturn nounwind memory(read, argmem: none, inaccessiblemem: readwrite )
48
48
// RECOVER-LABEL: define dso_local noundef i32 @_Z16test_unreachablev(
49
49
// RECOVER-SAME: ) local_unnamed_addr #[[ATTR2:[0-9]+]] {
50
50
// RECOVER-NEXT: [[ENTRY:.*:]]
51
+ // RECOVER-NEXT: tail call void @__ubsan_handle_divrem_overflow(ptr nonnull @{{.+}}, i64 1, i64 0) #[[ATTR3]], !nosanitize [[META9]]
51
52
// RECOVER-NEXT: unreachable
52
53
//
53
54
// ABORT: Function Attrs: mustprogress noreturn nounwind
@@ -65,9 +66,9 @@ int test_unreachable() {
65
66
}
66
67
67
68
// .
68
- // RECOVER: attributes #[[ATTR0]] = { mustprogress nounwind willreturn memory(read, argmem: readwrite, inaccessiblemem: readwrite) "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" }
69
- // RECOVER: attributes #[[ATTR1:[0-9]+]] = { mustprogress willreturn memory(argmem: read, inaccessiblemem: readwrite) uwtable }
70
- // RECOVER: attributes #[[ATTR2]] = { mustprogress nofree norecurse noreturn nosync nounwind willreturn memory(none) "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" }
69
+ // RECOVER: attributes #[[ATTR0]] = { mustprogress nounwind memory(read, argmem: readwrite, inaccessiblemem: readwrite) "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" }
70
+ // RECOVER: attributes #[[ATTR1:[0-9]+]] = { mustprogress memory(argmem: read, inaccessiblemem: readwrite) uwtable }
71
+ // RECOVER: attributes #[[ATTR2]] = { mustprogress noreturn nounwind memory(read, argmem: none, inaccessiblemem: readwrite ) "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" }
71
72
// RECOVER: attributes #[[ATTR3]] = { nomerge nounwind }
72
73
// .
73
74
// ABORT: attributes #[[ATTR0]] = { mustprogress nounwind "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" }
0 commit comments