[clang] 9e87878 - [test][CodeGen] Check noundef for omited return

Vitaly Buka via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 4 19:11:06 PST 2022


Author: Vitaly Buka
Date: 2022-12-04T19:10:17-08:00
New Revision: 9e8787821f62bc7856d9a4cdf439aadbaf43ed64

URL: https://github.com/llvm/llvm-project/commit/9e8787821f62bc7856d9a4cdf439aadbaf43ed64
DIFF: https://github.com/llvm/llvm-project/commit/9e8787821f62bc7856d9a4cdf439aadbaf43ed64.diff

LOG: [test][CodeGen] Check noundef for omited return

Added: 
    

Modified: 
    clang/test/CodeGen/msan-param-retval.c
    clang/test/CodeGen/msan-param-retval.cpp

Removed: 
    


################################################################################
diff  --git a/clang/test/CodeGen/msan-param-retval.c b/clang/test/CodeGen/msan-param-retval.c
index e0aae2d90fdc..b003ae21ba82 100644
--- a/clang/test/CodeGen/msan-param-retval.c
+++ b/clang/test/CodeGen/msan-param-retval.c
@@ -23,6 +23,13 @@ int foo() {
   return 1;
 }
 
-// CHECK:   define dso_local i32 @foo() #0 {
-// CHECK:        @__msan_retval_tls
+// CHECK: define dso_local i32 @foo() #0 {
+// CHECK:   @__msan_retval_tls
+// CHECK: }
+
+int noret() {
+}
+
+// CHECK: define dso_local i32 @noret() #0 {
+// CHECK:   %retval = alloca
 // CHECK: }
\ No newline at end of file

diff  --git a/clang/test/CodeGen/msan-param-retval.cpp b/clang/test/CodeGen/msan-param-retval.cpp
index 6926cce1080e..d34dafaa8eb6 100644
--- a/clang/test/CodeGen/msan-param-retval.cpp
+++ b/clang/test/CodeGen/msan-param-retval.cpp
@@ -28,4 +28,12 @@ int foo() {
 // CLEAN:        @__msan_retval_tls
 // NOUNDEF_ONLY: @__msan_retval_tls
 // EAGER-NOT:    @__msan_retval_tls
+// CHECK: }
+
+int noret() {
+}
+
+// CLEAN: define dso_local i32 @_Z5noretv() #0 {
+// NOUNDEF: define dso_local noundef i32 @_Z5noretv() #0 {
+// CHECK:  unreachable
 // CHECK: }
\ No newline at end of file


        


More information about the cfe-commits mailing list