[cfe-dev] Question about Clang codegen tests

David Blaikie via cfe-dev cfe-dev at lists.llvm.org
Thu Nov 25 12:20:23 PST 2021


FileCheck (which you can see in the RUN lines) is what consumes the CHECK
lines (or other suffixes, if specified in the FileCheck invocation in the
RUN line) - the thing that runs the RUN line is lit:
https://llvm.org/docs/CommandGuide/lit.html

On Thu, Nov 25, 2021 at 3:03 AM Diogo Sampaio via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Hi,
> see if this helps you tu understand the test it self:
> https://llvm.org/docs/CommandGuide/FileCheck.html
> And once you have a C/C++ input test file with a RUN: command on it, the
> test commands to check the result usually can be generated with the
> llvm-project/llvm/utils/update_cc_test_checks.py script.
> cheers
>
>
> *Diogo Sampaio*
> *Senior Compiler Engineer • Kalray*
> *dsampaio at kalrayinc.com <dsampaio at kalrayinc.com>* • *www.kalrayinc.com*
> <https://www.kalrayinc.com>
>
> [image: Kalray logo] <https://www.kalrayinc.com>
>
> * Please consider the environment before printing this e-mail.*
> This message contains information that may be privileged or confidential
> and is the property of Kalray S.A. It is intended only for the person to
> whom it is addressed. If you are not the intended recipient, you are not
> authorized to print, retain, copy, disseminate, distribute, or use this
> message or any part thereof. If you receive this message in error, please
> notify the sender immediately and delete all copies of this message.
>
>
> ------------------------------
> *From: *"cfe-dev" <cfe-dev at lists.llvm.org>
> *To: *"cfe-dev" <cfe-dev at lists.llvm.org>
> *Sent: *Thursday, November 25, 2021 11:54:27 AM
> *Subject: *[cfe-dev] Question about Clang codegen tests
>
> Hello, everyone!
>
> I'm a newcomer, and want to make some contributions to the LLVM community.
> Is here the right place to reach out for help? Please forgive me if I did
> things wrong, as I'm unfamiliar with the LLVM workflow :-)
>
> So a few days ago I noticed an issue in the bugzilla:
> https://bugs.llvm.org/show_bug.cgi?id=52444, I thought it would be
> suitable for me to work on. But now I run into some problems:
>
> * What is meaning of the capitalized words in tests comments?
> For example,  in
> `llvm-project/clang/test/CodeGen/builtins-elementwise-math.c`:
> ```
> // RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm
> -disable-llvm-passes -o - | FileCheck %s
> // CHECK-LABEL: define void @test_builtin_elementwise_abs(
> // CHECK: [[F1:%.+]] = load float, float* %f1.addr, align 4
> // CHECK-NEXT: call float @llvm.fabs.f32(float [[F1]])
> ```
> What do `RUN`, `CHECK` mean? I can guess they are some test instructions,
> so I briefly look through the docs, but I can't find anything useful :-(
> I'm sorry but the docs are so much, it's hard to find something I actually
> don't know what is.
>
> * How can I write my own test for codegen?
> The actual code part is not that hard, problems came in when I want to
> write some tests. The fact is that I'm unfamiliar with LLVM IR, so I don't
> know how to write the expected output...
>
> Thanks so much for people who offer me help!
>
> Best regards,
> Jun Zhang
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20211125/831de0c6/attachment.html>


More information about the cfe-dev mailing list