llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-clangir @llvm/pr-subscribers-clang Author: adams381 <details> <summary>Changes</summary> Add OGCG function signature checks to the three OpenACC atomic test files. Verifies CIR produces compatible output with classic Clang codegen. Made with [Cursor](https://cursor.com) --- Full diff: https://github.com/llvm/llvm-project/pull/190691.diff 3 Files Affected: - (modified) clang/test/CIR/CodeGenOpenACC/atomic-capture.cpp (+3) - (modified) clang/test/CIR/CodeGenOpenACC/atomic-update.cpp (+3) - (modified) clang/test/CIR/CodeGenOpenACC/atomic-write.cpp (+3) ``````````diff diff --git a/clang/test/CIR/CodeGenOpenACC/atomic-capture.cpp b/clang/test/CIR/CodeGenOpenACC/atomic-capture.cpp index 687cbd73e16fc..b149bd41980d1 100644 --- a/clang/test/CIR/CodeGenOpenACC/atomic-capture.cpp +++ b/clang/test/CIR/CodeGenOpenACC/atomic-capture.cpp @@ -1,4 +1,6 @@ // RUN: %clang_cc1 -fopenacc -triple x86_64-linux-gnu -Wno-openacc-self-if-potential-conflict -emit-cir -fclangir -triple x86_64-linux-pc %s -o - | FileCheck %s +// RUN: %clang_cc1 -fopenacc -triple x86_64-linux-gnu -Wno-openacc-self-if-potential-conflict -emit-llvm %s -o %t.ll +// RUN: FileCheck --check-prefix=OGCG --input-file=%t.ll %s struct HasOps { operator float(); @@ -7,6 +9,7 @@ struct HasOps { int operator++(int); }; +// OGCG: define {{.*}} void @_Z3useiif6HasOps(i32 {{.*}}, i32 {{.*}}, float {{.*}}) void use(int x, int v, float f, HasOps ops) { // CHECK: cir.func{{.*}}(%[[X_ARG:.*]]: !s32i{{.*}}, %[[V_ARG:.*]]: !s32i{{.*}}, %[[F_ARG:.*]]: !cir.float{{.*}}){{.*}}, %[[OPS_ARG:.*]]: !rec_HasOps{{.*}}) {{.*}}{ // CHECK-NEXT: %[[X_ALLOCA:.*]] = cir.alloca !s32i, !cir.ptr<!s32i>, ["x", init] diff --git a/clang/test/CIR/CodeGenOpenACC/atomic-update.cpp b/clang/test/CIR/CodeGenOpenACC/atomic-update.cpp index 65db274222d6a..d8018c9dcb6d9 100644 --- a/clang/test/CIR/CodeGenOpenACC/atomic-update.cpp +++ b/clang/test/CIR/CodeGenOpenACC/atomic-update.cpp @@ -1,10 +1,13 @@ // RUN: %clang_cc1 -fopenacc -triple x86_64-linux-gnu -Wno-openacc-self-if-potential-conflict -emit-cir -fclangir -triple x86_64-linux-pc %s -o - | FileCheck %s +// RUN: %clang_cc1 -fopenacc -triple x86_64-linux-gnu -Wno-openacc-self-if-potential-conflict -emit-llvm %s -o %t.ll +// RUN: FileCheck --check-prefix=OGCG --input-file=%t.ll %s struct HasOps { operator float(); int thing(); }; +// OGCG: define {{.*}} void @_Z3useijf6HasOps(i32 {{.*}}, i32 {{.*}}, float {{.*}}) void use(int x, unsigned int y, float f, HasOps ops) { // CHECK: cir.func{{.*}}(%[[X_ARG:.*]]: !s32i{{.*}}, %[[Y_ARG:.*]]: !u32i{{.*}}, %[[F_ARG:.*]]: !cir.float{{.*}}){{.*}}, %[[OPS_ARG:.*]]: !rec_HasOps{{.*}}) {{.*}}{ // CHECK-NEXT: %[[X_ALLOCA:.*]] = cir.alloca !s32i, !cir.ptr<!s32i>, ["x", init] diff --git a/clang/test/CIR/CodeGenOpenACC/atomic-write.cpp b/clang/test/CIR/CodeGenOpenACC/atomic-write.cpp index 8c903ac8ce8eb..29b650515c71c 100644 --- a/clang/test/CIR/CodeGenOpenACC/atomic-write.cpp +++ b/clang/test/CIR/CodeGenOpenACC/atomic-write.cpp @@ -1,4 +1,6 @@ // RUN: %clang_cc1 -fopenacc -triple x86_64-linux-gnu -Wno-openacc-self-if-potential-conflict -emit-cir -fclangir -triple x86_64-linux-pc %s -o - | FileCheck %s +// RUN: %clang_cc1 -fopenacc -triple x86_64-linux-gnu -Wno-openacc-self-if-potential-conflict -emit-llvm %s -o %t.ll +// RUN: FileCheck --check-prefix=OGCG --input-file=%t.ll %s extern "C" bool condition(int x, unsigned int y, float f); extern "C" double do_thing(float f); @@ -7,6 +9,7 @@ struct ConvertsToScalar { operator float(); }; +// OGCG: define {{.*}} void @_Z3useijf16ConvertsToScalar(i32 {{.*}}, i32 {{.*}}, float {{.*}}) void use(int x, unsigned int y, float f, ConvertsToScalar cts) { // CHECK: cir.func{{.*}}(%[[X_ARG:.*]]: !s32i{{.*}}, %[[Y_ARG:.*]]: !u32i{{.*}}, %[[F_ARG:.*]]: !cir.float{{.*}}){{.*}}, %[[CTS_ARG:.*]]: !rec_ConvertsToScalar{{.*}}) {{.*}}{ // CHECK-NEXT: %[[X_ALLOC:.*]] = cir.alloca !s32i, !cir.ptr<!s32i>, ["x", init] `````````` </details> https://github.com/llvm/llvm-project/pull/190691 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
