From 19f4037ae6e6016e9978f6b3012afe5e1991aaf1 Mon Sep 17 00:00:00 2001 From: "John F. Carr" Date: Tue, 27 Aug 2024 13:32:54 -0400 Subject: [PATCH] Test for reducer struct member register and unregister. This test currently fails because registration is not working. --- clang/test/Cilk/hyper-register.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 clang/test/Cilk/hyper-register.cpp diff --git a/clang/test/Cilk/hyper-register.cpp b/clang/test/Cilk/hyper-register.cpp new file mode 100644 index 000000000000..cedddc1e6843 --- /dev/null +++ b/clang/test/Cilk/hyper-register.cpp @@ -0,0 +1,21 @@ +// RUN: %clang_cc1 %s -x c++ -fopencilk -S -emit-llvm -disable-llvm-passes -triple aarch64-freebsd14.1 -o - | FileCheck %s + +struct S { + static void identity(void *); + static void reduce(void *, void *); + int _Hyperobject(identity, reduce) member; + S(); + ~S(); +}; + +// CHECK-LABEL: _ZN1SC2Ev +// CHECK: call void @llvm.reducer.register +S::S() {} + +// CHECK-LABEL: _ZN1SD2Ev +// CHECK: call void @llvm.reducer.unregister +S::~S() {} + +void f() { + struct S s; +}