Page MenuHomePhabricator

[LLVMFrontend][openacc] Add basic unit tests for functions in LLVMFrontendOpenACC
Needs ReviewPublic

Authored by clementval on Tue, Nov 17, 11:34 AM.

Details

Summary

Add unit tests for functions in LLVMFrontendOpenACC. As notice in D91470 these functions were not tested
as well as the ones for OpenMP (D91643). This patch add tests for the OpenACC part.

Diff Detail

Unit TestsFailed

TimeTest
390 mslinux > HWAddressSanitizer-x86_64.TestCases::sizes.cpp
Script: -- : 'RUN: at line 3'; /mnt/disks/ssd0/agent/llvm-project/build/./bin/clang --driver-mode=g++ -m64 -gline-tables-only -fsanitize=hwaddress -fuse-ld=lld -mcmodel=large -mllvm -hwasan-globals -mllvm -hwasan-use-short-granules -mllvm -hwasan-instrument-landing-pads=0 -mllvm -hwasan-instrument-personality-functions /mnt/disks/ssd0/agent/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp -nostdlib++ -lstdc++ -o /mnt/disks/ssd0/agent/llvm-project/build/projects/compiler-rt/test/hwasan/X86_64/TestCases/Output/sizes.cpp.tmp

Event Timeline

clementval created this revision.Tue, Nov 17, 11:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptTue, Nov 17, 11:34 AM
clementval requested review of this revision.Tue, Nov 17, 11:34 AM
clementval edited reviewers, added: Meinersbur; removed: clementval.Tue, Nov 17, 11:46 AM
Meinersbur added inline comments.Tue, Nov 17, 2:49 PM
llvm/unittests/Frontend/OpenACCTest.cpp
20

Since this array is never modified, use a plain old array for this, which doesn't need a static constructor:

static const Clause allClauses[] = ...
67–72

This fixup doesn't do anything, you can just used the non-fixup versions ('TEST(..)' instead of TEST_F)

220

std::initializer_list is unusual for non-constructors. Use ArrayRef?

clementval marked 3 inline comments as done.

Address review comments

@Meinersbur Thanks for the review. Just updated the patch.

llvm/unittests/Frontend/OpenACCTest.cpp
67–72

Thanks for the tip.