Author: Nathan Sidwell
Date: 2022-11-21T14:20:47-05:00
New Revision: eff9d72b9b63b5c2f506581180db34df3b70bec9

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

LOG: [clang] NFC: Robustify sret test regex

Replace old-style, brittle, grep with new-fangled FileCheck technology.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D137941

Added: 
    

Modified: 
    clang/test/CodeGen/sret.c

Removed: 
    clang/test/CodeGen/sret2.c


################################################################################
diff  --git a/clang/test/CodeGen/sret.c b/clang/test/CodeGen/sret.c
index 1ae83feb26ffe..548581d3e3dc6 100644
--- a/clang/test/CodeGen/sret.c
+++ b/clang/test/CodeGen/sret.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -Wno-strict-prototypes -emit-llvm -o - | grep sret | 
grep -v 'sret.c' | count 4
+// RUN: %clang_cc1 %s -Wno-strict-prototypes -emit-llvm -o - | FileCheck %s
 
 struct abc {
  long a;
@@ -7,11 +7,17 @@ struct abc {
  long d;
  long e;
 };
- 
+
 struct abc foo1(void);
+// CHECK-DAG: declare {{.*}} @foo1(ptr sret(%struct.abc)
 struct abc foo2();
+// CHECK-DAG: declare {{.*}} @foo2(ptr sret(%struct.abc)
+struct abc foo3(void){}
+// CHECK-DAG: define {{.*}} @foo3(ptr noalias sret(%struct.abc)
 
 void bar(void) {
   struct abc dummy1 = foo1();
+  // CHECK-DAG: call {{.*}} @foo1(ptr sret(%struct.abc)
   struct abc dummy2 = foo2();
+  // CHECK-DAG: call {{.*}} @foo2(ptr sret(%struct.abc)
 }

diff  --git a/clang/test/CodeGen/sret2.c b/clang/test/CodeGen/sret2.c
deleted file mode 100644
index 5f1f6f0620965..0000000000000
--- a/clang/test/CodeGen/sret2.c
+++ /dev/null
@@ -1,11 +0,0 @@
-// RUN: %clang_cc1 %s -emit-llvm -o - | grep sret | grep -v 'sret2.c' | count 1
-
-struct abc {
- long a;
- long b;
- long c;
- long d;
- long e;
-};
- 
-struct abc foo2(void){}


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to