[clang] 00a0282 - [Clang] Remove run-lines which use opt to run -ipconstprop.

Florian Hahn via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 2 13:53:59 PDT 2020


Author: Florian Hahn
Date: 2020-08-02T21:47:32+01:00
New Revision: 00a0282ff8f9a790e93c19ef6fa3758e209cdbe6

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

LOG: [Clang] Remove run-lines which use opt to run -ipconstprop.

ipconstprop is going to get removed and checking opt with specific
passes makes the tests more fragile.

The tests retain the important checks that !callback metadata is created
correctly.

Added: 
    

Modified: 
    clang/test/CodeGen/callback_annotated.c
    clang/test/CodeGen/callback_openmp.c
    clang/test/CodeGen/callback_pthread_create.c

Removed: 
    


################################################################################
diff  --git a/clang/test/CodeGen/callback_annotated.c b/clang/test/CodeGen/callback_annotated.c
index c5b431d5ef84..83a79c3491da 100644
--- a/clang/test/CodeGen/callback_annotated.c
+++ b/clang/test/CodeGen/callback_annotated.c
@@ -1,6 +1,4 @@
-// RUN: %clang_cc1 -triple i386-unknown-unknown -fopenmp -O1 -fno-experimental-new-pass-manager %s -emit-llvm -o - | FileCheck %s --check-prefix=RUN1
-// RUN: %clang_cc1 -triple i386-unknown-unknown -fopenmp -O1 -fno-experimental-new-pass-manager %s -emit-llvm -o - | FileCheck %s --check-prefix=RUN2
-// RUN: %clang_cc1 -triple i386-unknown-unknown -fopenmp -O1 -fno-experimental-new-pass-manager %s -emit-llvm -o - | opt -ipconstprop -S | FileCheck --check-prefix=IPCP %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -fopenmp -fno-experimental-new-pass-manager %s -emit-llvm -o - -disable-llvm-optzns | FileCheck %s --check-prefix=RUN1
 
 // RUN1-DAG: @broker0({{[^#]*#[0-9]+}} !callback ![[cid0:[0-9]+]]
 __attribute__((callback(1, 2))) void *broker0(void *(*callee)(void *), void *payload) {
@@ -29,22 +27,10 @@ __attribute__((callback(4, -1, a, __))) void *broker4(int a, int, int, int (*cal
 __attribute__((callback(4, d, 5, 2))) void *broker5(int, int, int, int (*callee)(int, int, int), int d);
 
 static void *VoidPtr2VoidPtr(void *payload) {
-  // RUN2: ret i8* %payload
-  // IPCP: ret i8* null
   return payload;
 }
 
 static int ThreeInt2Int(int a, int b, int c) {
-  // RUN2:   define internal i32 @ThreeInt2Int(i32 %a, i32 %b, i32 %c)
-  // RUN2:     %mul = mul nsw i32 %b, %a
-  // RUN2:     %add = add nsw i32 %mul, %c
-  // RUN2:     ret i32 %add
-
-  // IPCP:   define internal i32 @ThreeInt2Int(i32 %a, i32 %b, i32 %c)
-  // IPCP:     %mul = mul nsw i32 4, %a
-  // IPCP:     %add = add nsw i32 %mul, %c
-  // IPCP:     ret i32 %add
-
   return a * b + c;
 }
 

diff  --git a/clang/test/CodeGen/callback_openmp.c b/clang/test/CodeGen/callback_openmp.c
index 2fc9dcd391f6..90e63fdb2e58 100644
--- a/clang/test/CodeGen/callback_openmp.c
+++ b/clang/test/CodeGen/callback_openmp.c
@@ -1,5 +1,4 @@
-// RUN: %clang_cc1 -triple i386-unknown-unknown -fopenmp -O1 %s -emit-llvm -o - | FileCheck %s
-// RUN: %clang_cc1 -triple i386-unknown-unknown -fopenmp -O1 %s -emit-llvm -o - | opt -ipconstprop -S | FileCheck --check-prefix=IPCP %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -fopenmp %s -emit-llvm -o - -disable-llvm-optzns | FileCheck %s
 
 // CHECK: declare !callback ![[cid:[0-9]+]] void @__kmpc_fork_call
 // CHECK: declare !callback ![[cid]] void @__kmpc_fork_teams
@@ -15,14 +14,11 @@ void foo(int q) {
 
   #pragma omp parallel firstprivate(q, p)
   work1(p, q);
-// IPCP: call void @work1(i32 2, i32 %{{[._a-zA-Z0-9]*}})
 
   #pragma omp parallel for firstprivate(p, q)
   for (int i = 0; i < q; i++)
     work2(i, p);
-// IPCP: call void @work2(i32 %{{[._a-zA-Z0-9]*}}, i32 2)
 
   #pragma omp target teams firstprivate(p)
   work12(p, p);
-// IPCP: call void @work12(i32 2, i32 2)
 }

diff  --git a/clang/test/CodeGen/callback_pthread_create.c b/clang/test/CodeGen/callback_pthread_create.c
index 785440030b32..d1b01b91eac3 100644
--- a/clang/test/CodeGen/callback_pthread_create.c
+++ b/clang/test/CodeGen/callback_pthread_create.c
@@ -1,5 +1,4 @@
-// RUN: %clang_cc1 -O1 %s -S -emit-llvm -o - | FileCheck %s
-// RUN: %clang_cc1 -O1 %s -S -emit-llvm -o - | opt -ipconstprop -S | FileCheck --check-prefix=IPCP %s
+// RUN: %clang_cc1 %s -S -emit-llvm -o - -disable-llvm-optzns | FileCheck %s
 
 // CHECK: declare !callback ![[cid:[0-9]+]] {{.*}}i32 @pthread_create
 // CHECK: ![[cid]] = !{![[cidb:[0-9]+]]}
@@ -21,14 +20,10 @@ int pthread_create(pthread_t *, const pthread_attr_t *,
 const int GlobalVar = 0;
 
 static void *callee0(void *payload) {
-// IPCP:      define internal i8* @callee0
-// IPCP:        ret i8* null
   return payload;
 }
 
 static void *callee1(void *payload) {
-// IPCP:      define internal i8* @callee1
-// IPCP:        ret i8* bitcast (i32* @GlobalVar to i8*)
   return payload;
 }
 


        


More information about the cfe-commits mailing list