================
@@ -0,0 +1,304 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 
UTC_ARGS: --version 4
+; RUN: llc < %s -march=bpf | FileCheck %s
+
+; test that we can expand CTTZ & CTLZ
+
+declare i32 @llvm.cttz.i32(i32, i1)
+
+define i32 @cttz_i32_zdef(i32 %a) {
+; CHECK-LABEL: cttz_i32_zdef:
----------------
eddyz87 wrote:

> I think for compilers "CodeGen" tests, it is common to assert "Generated Asm" 
> without actually run it. For example, for aarch64 backend developers, a 
> "trick" is to write some code on x86 machine, testing the assembly without 
> aarch64 emulator(e.g. qemu-user).

Actually, I meant to skip matching the full expansion and just do something 
like below:

```
; CHECK-LABEL: cttz_i32_zdef:
; CHECK:         r0 =
; CHECK:         exit
```

(As we don't really test the expansion logic, we just test that some expansion 
is applied).

> So IMHO, for LLVM codegen we can just CHECK-NEXT: these asm lines. (They can 
> be automatically generated)

You mean `utils/update_llc_test_checks`, right?
Well, maybe that's good enough, at-least the tests are easy to adjust if 
anything changes.

https://github.com/llvm/llvm-project/pull/73668
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to