[llvm] 91b82ce - NFC: Switch to update_test_checks for a couple tests.
James Y Knight via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 9 11:24:09 PDT 2023
Author: James Y Knight
Date: 2023-08-09T14:23:45-04:00
New Revision: 91b82ce0233cddeb421e84fd3eb1a1cb3d9ebb6a
URL: https://github.com/llvm/llvm-project/commit/91b82ce0233cddeb421e84fd3eb1a1cb3d9ebb6a
DIFF: https://github.com/llvm/llvm-project/commit/91b82ce0233cddeb421e84fd3eb1a1cb3d9ebb6a.diff
LOG: NFC: Switch to update_test_checks for a couple tests.
(Pre-commit ahead of actual modifications.)
Added:
Modified:
llvm/test/Instrumentation/ThreadSanitizer/eh.ll
llvm/test/Transforms/InstCombine/nothrow.ll
Removed:
################################################################################
diff --git a/llvm/test/Instrumentation/ThreadSanitizer/eh.ll b/llvm/test/Instrumentation/ThreadSanitizer/eh.ll
index 37a86559ab6e63..9c08b8f077e946 100644
--- a/llvm/test/Instrumentation/ThreadSanitizer/eh.ll
+++ b/llvm/test/Instrumentation/ThreadSanitizer/eh.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
; RUN: opt < %s -passes=tsan -S | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-EXC
; RUN: opt < %s -passes=tsan -S -tsan-handle-cxx-exceptions=0 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-NOEXC
@@ -7,51 +8,69 @@ declare void @can_throw()
declare void @cannot_throw() nounwind
define i32 @func1() sanitize_thread {
+; CHECK-EXC-LABEL: define i32 @func1
+; CHECK-EXC-SAME: () #[[ATTR1:[0-9]+]] personality ptr @__gcc_personality_v0 {
+; CHECK-EXC-NEXT: [[TMP1:%.*]] = call ptr @llvm.returnaddress(i32 0)
+; CHECK-EXC-NEXT: call void @__tsan_func_entry(ptr [[TMP1]])
+; CHECK-EXC-NEXT: invoke void @can_throw()
+; CHECK-EXC-NEXT: to label [[DOTNOEXC:%.*]] unwind label [[TSAN_CLEANUP:%.*]]
+; CHECK-EXC: .noexc:
+; CHECK-EXC-NEXT: call void @__tsan_func_exit()
+; CHECK-EXC-NEXT: ret i32 0
+; CHECK-EXC: tsan_cleanup:
+; CHECK-EXC-NEXT: [[CLEANUP_LPAD:%.*]] = landingpad { ptr, i32 }
+; CHECK-EXC-NEXT: cleanup
+; CHECK-EXC-NEXT: call void @__tsan_func_exit()
+; CHECK-EXC-NEXT: resume { ptr, i32 } [[CLEANUP_LPAD]]
+;
+; CHECK-NOEXC-LABEL: define i32 @func1
+; CHECK-NOEXC-SAME: () #[[ATTR1:[0-9]+]] {
+; CHECK-NOEXC-NEXT: [[TMP1:%.*]] = call ptr @llvm.returnaddress(i32 0)
+; CHECK-NOEXC-NEXT: call void @__tsan_func_entry(ptr [[TMP1]])
+; CHECK-NOEXC-NEXT: call void @can_throw()
+; CHECK-NOEXC-NEXT: call void @__tsan_func_exit()
+; CHECK-NOEXC-NEXT: ret i32 0
+;
call void @can_throw()
ret i32 0
- ; CHECK-EXC: define i32 @func1()
- ; CHECK-EXC: call void @__tsan_func_entry
- ; CHECK-EXC: invoke void @can_throw()
- ; CHECK-EXC: .noexc:
- ; CHECK-EXC: call void @__tsan_func_exit()
- ; CHECK-EXC: ret i32 0
- ; CHECK-EXC: tsan_cleanup:
- ; CHECK-EXC: call void @__tsan_func_exit()
- ; CHECK-EXC: resume
- ; CHECK-NOEXC: define i32 @func1()
- ; CHECK-NOEXC: call void @__tsan_func_entry
- ; CHECK-NOEXC: call void @can_throw()
- ; CHECK-NOEXC: call void @__tsan_func_exit()
- ; CHECK-NOEXC: ret i32 0
}
define i32 @func2() sanitize_thread {
+; CHECK-LABEL: define i32 @func2
+; CHECK-SAME: () #[[ATTR1:[0-9]+]] {
+; CHECK-NEXT: [[TMP1:%.*]] = call ptr @llvm.returnaddress(i32 0)
+; CHECK-NEXT: call void @__tsan_func_entry(ptr [[TMP1]])
+; CHECK-NEXT: call void @cannot_throw()
+; CHECK-NEXT: call void @__tsan_func_exit()
+; CHECK-NEXT: ret i32 0
+;
call void @cannot_throw()
ret i32 0
- ; CHECK: define i32 @func2()
- ; CHECK: call void @__tsan_func_entry
- ; CHECK: call void @cannot_throw()
- ; CHECK: call void @__tsan_func_exit()
- ; CHECK: ret i32 0
}
define i32 @func3(ptr %p) sanitize_thread {
+; CHECK-LABEL: define i32 @func3
+; CHECK-SAME: (ptr [[P:%.*]]) #[[ATTR1]] {
+; CHECK-NEXT: [[TMP1:%.*]] = call ptr @llvm.returnaddress(i32 0)
+; CHECK-NEXT: call void @__tsan_func_entry(ptr [[TMP1]])
+; CHECK-NEXT: call void @__tsan_read4(ptr [[P]])
+; CHECK-NEXT: [[A:%.*]] = load i32, ptr [[P]], align 4
+; CHECK-NEXT: call void @__tsan_func_exit()
+; CHECK-NEXT: ret i32 [[A]]
+;
%a = load i32, ptr %p
ret i32 %a
- ; CHECK: define i32 @func3(ptr %p)
- ; CHECK: call void @__tsan_func_entry
- ; CHECK: call void @__tsan_read4
- ; CHECK: %a = load i32, ptr %p
- ; CHECK: call void @__tsan_func_exit()
- ; CHECK: ret i32 %a
}
define i32 @func4() sanitize_thread nounwind {
+; CHECK-LABEL: define i32 @func4
+; CHECK-SAME: () #[[ATTR2:[0-9]+]] {
+; CHECK-NEXT: [[TMP1:%.*]] = call ptr @llvm.returnaddress(i32 0)
+; CHECK-NEXT: call void @__tsan_func_entry(ptr [[TMP1]])
+; CHECK-NEXT: call void @can_throw()
+; CHECK-NEXT: call void @__tsan_func_exit()
+; CHECK-NEXT: ret i32 0
+;
call void @can_throw()
ret i32 0
- ; CHECK: define i32 @func4()
- ; CHECK: call void @__tsan_func_entry
- ; CHECK: call void @can_throw()
- ; CHECK: call void @__tsan_func_exit()
- ; CHECK: ret i32 0
}
diff --git a/llvm/test/Transforms/InstCombine/nothrow.ll b/llvm/test/Transforms/InstCombine/nothrow.ll
index 7deb4f0f0272c2..4e70acb612678d 100644
--- a/llvm/test/Transforms/InstCombine/nothrow.ll
+++ b/llvm/test/Transforms/InstCombine/nothrow.ll
@@ -1,8 +1,18 @@
-; RUN: opt < %s -passes=instcombine -S | not grep call
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-attributes --check-globals --version 2
+; RUN: opt < %s -passes=instcombine -S | FileCheck %s
; rdar://6880732
declare double @t1(i32) readonly willreturn
define void @t2() nounwind {
+; CHECK: Function Attrs: nounwind
+; CHECK-LABEL: define void @t2
+; CHECK-SAME: () #[[ATTR1:[0-9]+]] {
+; CHECK-NEXT: ret void
+;
call double @t1(i32 42) ;; dead call even though callee is not nothrow.
ret void
}
+;.
+; CHECK: attributes #[[ATTR0:[0-9]+]] = { willreturn memory(read) }
+; CHECK: attributes #[[ATTR1]] = { nounwind }
+;.
More information about the llvm-commits
mailing list