Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add Four Codegen Tests #134626

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

veera-sivarajan
Copy link
Contributor

Closes #74615
Closes #123216
Closes #49572
Closes #93514

This PR adds four codegen tests. The FileCheck assertions were generated with the help of update_test_checks.py and update_llc_test_checks.py from the LLVM project.

@rustbot
Copy link
Collaborator

rustbot commented Dec 21, 2024

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 21, 2024
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@Mark-Simulacrum
Copy link
Member

@bors r+ rollup=iffy

@bors
Copy link
Contributor

bors commented Dec 26, 2024

📌 Commit 62fedef has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 26, 2024
@bors
Copy link
Contributor

bors commented Dec 27, 2024

⌛ Testing commit 62fedef with merge 655cf53...

bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 27, 2024
…r=Mark-Simulacrum

Add Four Codegen Tests

Closes rust-lang#74615
Closes rust-lang#123216
Closes rust-lang#49572
Closes rust-lang#93514

This PR adds four codegen tests. The FileCheck assertions were generated with the help of `update_test_checks.py` and `update_llc_test_checks.py` from the LLVM project.
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Dec 27, 2024

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 27, 2024
@Mark-Simulacrum
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jan 11, 2025

📌 Commit 0ec717b has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 11, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 12, 2025
…r=Mark-Simulacrum

Add Four Codegen Tests

Closes rust-lang#74615
Closes rust-lang#123216
Closes rust-lang#49572
Closes rust-lang#93514

This PR adds four codegen tests. The FileCheck assertions were generated with the help of `update_test_checks.py` and `update_llc_test_checks.py` from the LLVM project.
@bors
Copy link
Contributor

bors commented Jan 12, 2025

⌛ Testing commit 0ec717b with merge 159ccc2...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Jan 12, 2025

💔 Test failed - checks-actions

@veera-sivarajan
Copy link
Contributor Author

@rustbot review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 5, 2025
@Mark-Simulacrum
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Feb 8, 2025

📌 Commit dfca140 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 8, 2025
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Feb 10, 2025
…, r=Mark-Simulacrum

Add Four Codegen Tests

Closes rust-lang#74615
Closes rust-lang#123216
Closes rust-lang#49572
Closes rust-lang#93514

This PR adds four codegen tests. The FileCheck assertions were generated with the help of `update_test_checks.py` and `update_llc_test_checks.py` from the LLVM project.
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 10, 2025
…kingjubilee

Rollup of 4 pull requests

Successful merges:

 - rust-lang#133092 (Always set the deployment target when building std)
 - rust-lang#134626 (Add Four Codegen Tests)
 - rust-lang#136053 (coverage: Defer part of counter-creation until codegen)
 - rust-lang#136707 (Bump `cc` to v1.2.12 for the compiler workspace)

r? `@ghost`
`@rustbot` modify labels: rollup
Zalathar added a commit to Zalathar/rust that referenced this pull request Feb 10, 2025
…, r=Mark-Simulacrum

Add Four Codegen Tests

Closes rust-lang#74615
Closes rust-lang#123216
Closes rust-lang#49572
Closes rust-lang#93514

This PR adds four codegen tests. The FileCheck assertions were generated with the help of `update_test_checks.py` and `update_llc_test_checks.py` from the LLVM project.
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 10, 2025
Rollup of 6 pull requests

Successful merges:

 - rust-lang#134626 (Add Four Codegen Tests)
 - rust-lang#136053 (coverage: Defer part of counter-creation until codegen)
 - rust-lang#136228 (Simplify Rc::as_ptr docs + typo fix)
 - rust-lang#136487 (ci: stop mysql before removing it)
 - rust-lang#136790 (Git blame ignore recent formatting commit)
 - rust-lang#136803 (Subtree update of `rust-analyzer`)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 10, 2025
Rollup of 6 pull requests

Successful merges:

 - rust-lang#134626 (Add Four Codegen Tests)
 - rust-lang#136053 (coverage: Defer part of counter-creation until codegen)
 - rust-lang#136228 (Simplify Rc::as_ptr docs + typo fix)
 - rust-lang#136487 (ci: stop mysql before removing it)
 - rust-lang#136790 (Git blame ignore recent formatting commit)
 - rust-lang#136803 (Subtree update of `rust-analyzer`)

r? `@ghost`
`@rustbot` modify labels: rollup
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Feb 10, 2025
…, r=Mark-Simulacrum

Add Four Codegen Tests

Closes rust-lang#74615
Closes rust-lang#123216
Closes rust-lang#49572
Closes rust-lang#93514

This PR adds four codegen tests. The FileCheck assertions were generated with the help of `update_test_checks.py` and `update_llc_test_checks.py` from the LLVM project.
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 10, 2025
…kingjubilee

Rollup of 9 pull requests

Successful merges:

 - rust-lang#134626 (Add Four Codegen Tests)
 - rust-lang#135408 (x86: make SSE2 required for i686 hardfloat targets and use it to pass SIMD types)
 - rust-lang#136155 (Enable sanitizers on MSVC CI jobs)
 - rust-lang#136419 (adding autodiff tests)
 - rust-lang#136603 (compiler: gate `extern "{abi}"` in ast_lowering)
 - rust-lang#136628 (ci: upgrade to crosstool-ng 1.27.0)
 - rust-lang#136714 (Update `compiler-builtins` to 0.1.146)
 - rust-lang#136731 (rustc_middle: parallel: TyCtxt: remove "unsafe impl DynSend/DynSync")
 - rust-lang#136761 (tests: `-Copt-level=3` instead of `-O` in codegen tests)

r? `@ghost`
`@rustbot` modify labels: rollup
@workingjubilee
Copy link
Member

@bors p=5

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 11, 2025
…r=Mark-Simulacrum

Add Four Codegen Tests

Closes rust-lang#74615
Closes rust-lang#123216
Closes rust-lang#49572
Closes rust-lang#93514

This PR adds four codegen tests. The FileCheck assertions were generated with the help of `update_test_checks.py` and `update_llc_test_checks.py` from the LLVM project.
@bors
Copy link
Contributor

bors commented Feb 11, 2025

⌛ Testing commit dfca140 with merge 0d4241f...

@rust-log-analyzer
Copy link
Collaborator

The job arm-android failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
test [codegen] tests/codegen/cfguard-non-msvc.rs ... ok
test [codegen] tests/codegen/char-ascii-branchless.rs ... ok
test [codegen] tests/codegen/checked_ilog.rs ... ok
test [codegen] tests/codegen/checked_math.rs ... ok
test [codegen] tests/codegen/classify-fp-category-of-usize-without-branch.rs ... FAILED
test [codegen] tests/codegen/codemodels.rs#MODEL-LARGE ... ignored, only executed when the architecture is x86_64
test [codegen] tests/codegen/codemodels.rs#MODEL-MEDIUM ... ignored, only executed when the architecture is x86_64
test [codegen] tests/codegen/codemodels.rs#MODEL-SMALL ... ignored, only executed when the architecture is x86_64
test [codegen] tests/codegen/codemodels.rs#NOMODEL ... ignored, only executed when the architecture is x86_64
---
test [codegen] tests/codegen/zip.rs ... ok

failures:

---- [codegen] tests/codegen/classify-fp-category-of-usize-without-branch.rs stdout ----

error: verification with 'FileCheck' failed
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck" "--input-file" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/classify-fp-category-of-usize-without-branch/classify-fp-category-of-usize-without-branch.ll" "/checkout/tests/codegen/classify-fp-category-of-usize-without-branch.rs" "--check-prefix=CHECK" "--allow-unused-prefixes" "--dump-input-context" "100"
--- stderr -------------------------------
--- stderr -------------------------------
/checkout/tests/codegen/classify-fp-category-of-usize-without-branch.rs:29:12: error: CHECK: expected string not found in input
 // CHECK: [[TMP0:%.*]] = tail call
           ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/classify-fp-category-of-usize-without-branch/classify-fp-category-of-usize-without-branch.ll:7:41: note: scanning from here
define noundef zeroext i1 @complex_test(i32 noundef %input) unnamed_addr #0 {
                                        ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/classify-fp-category-of-usize-without-branch/classify-fp-category-of-usize-without-branch.ll:33:82: note: possible intended match here
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable


Input file: /checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/classify-fp-category-of-usize-without-branch/classify-fp-category-of-usize-without-branch.ll
Check file: /checkout/tests/codegen/classify-fp-category-of-usize-without-branch.rs

-dump-input=help explains the following input dump.
Input was:
<<<<<<
<<<<<<
            1: ; ModuleID = 'classify_fp_category_of_usize_without_branch.126dbdb42f0b9381-cgu.0' 
            2: source_filename = "classify_fp_category_of_usize_without_branch.126dbdb42f0b9381-cgu.0" 
            3: target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64" 
            4: target triple = "arm-unknown-linux-android" 
            5:  
            6: ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable 
            7: define noundef zeroext i1 @complex_test(i32 noundef %input) unnamed_addr #0 { 
check:29'0                                             X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
check:29'0     ~~~~~~~
check:29'0     ~~~~~~~
            9:  switch i32 %input, label %bb2 [ 
check:29'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           10:  i32 128, label %bb1 
check:29'0     ~~~~~~~~~~~~~~~~~~~~~
           11:  i32 1, label %bb1 
check:29'0     ~~~~~~~~~~~~~~~~~~~
           12:  i32 64, label %bb1 
check:29'0     ~~~~~~~~~~~~~~~~~~~~
           13:  i32 2, label %bb1 
check:29'0     ~~~~~~~~~~~~~~~~~~~
           14:  i32 32, label %bb1 
check:29'0     ~~~~~~~~~~~~~~~~~~~~
           15:  i32 4, label %bb1 
check:29'0     ~~~~~~~~~~~~~~~~~~~
           16:  i32 16, label %bb4 
check:29'0     ~~~~~~~~~~~~~~~~~~~~
           17:  i32 8, label %bb4 
check:29'0     ~~~~~~~~~~~~~~~~~~~
           18:  i32 256, label %bb1 
check:29'0     ~~~~~~~~~~~~~~~~~~~~~
           19:  i32 512, label %bb1 
check:29'0     ~~~~~~~~~~~~~~~~~~~~~
           20:  ] 
check:29'0     ~~~
check:29'0     ~
check:29'0     ~
           22: bb2: ; preds = %start 
check:29'0     ~~~~~~~~~~~~~~~~~~~~~~
           23:  unreachable 
check:29'0     ~~~~~~~~~~~~~
check:29'0     ~
check:29'0     ~
           25: bb4: ; preds = %start, %start 
check:29'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           26:  br label %bb1 
check:29'0     ~~~~~~~~~~~~~~~
check:29'0     ~
check:29'0     ~
           28: bb1: ; preds = %start, %start, %start, %start, %start, %start, %start, %start, %bb4 
check:29'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           29:  %_0 = phi i1 [ true, %bb4 ], [ false, %start ], [ false, %start ], [ false, %start ], [ false, %start ], [ false, %start ], [ false, %start ], [ false, %start ], [ false, %start ] 
check:29'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           30:  ret i1 %_0 
check:29'0     ~~~~~~~~~~~~
           31: } 
check:29'0     ~~
check:29'0     ~
check:29'0     ~
           33: ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable 
check:29'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:29'1                                                                                      ?               possible intended match
           34: define noundef zeroext i1 @simpler_test(i32 noundef %input) unnamed_addr #0 { 
check:29'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           35: start: 
           36:  %0 = add i32 %input, -8 
           37:  %switch.and = and i32 %0, -9 
           38:  %switch.selectcmp = icmp eq i32 %switch.and, 0 
           39:  ret i1 %switch.selectcmp 
           40: } 
           41:  
           42: attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "target-cpu"="generic" "target-features"="+strict-align,+v5te" } 
           43:  
           44: !llvm.module.flags = !{!0} 
           45: !llvm.ident = !{!1} 
           46:  
           47: !0 = !{i32 8, !"PIC Level", i32 2} 
           48: !1 = !{!"rustc version 1.86.0-nightly (0d4241f04 2025-02-11)"} 
------------------------------------------




failures:
    [codegen] tests/codegen/classify-fp-category-of-usize-without-branch.rs
test result: FAILED. 620 passed; 1 failed; 201 ignored; 0 measured; 0 filtered out; finished in 11.86s

Some tests failed in compiletest suite=codegen mode=codegen host=x86_64-unknown-linux-gnu target=arm-linux-androideabi
Build completed unsuccessfully in 0:51:08

@bors
Copy link
Contributor

bors commented Feb 11, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 11, 2025
@veera-sivarajan
Copy link
Contributor Author

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 12, 2025
Copy link
Member

@DianQK DianQK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR adds four codegen tests. The FileCheck assertions were generated with the help of update_test_checks.py and update_llc_test_checks.py from the LLVM project.

Should we use them? Or should we add so many CHECK?

Unlike LLVM, we test multiple platforms in Rust, and this IR also comes from codegen. These IRs can vary.

// CHECK: andl $1, %eax
// CHECK: shll $4, %eax
// CHECK: orb $1, (%rcx,%rax)
// CHECK-NOT: jmp
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question: should this be an assembly test?
The IR change was introduced by llvm/llvm-project#84628, and this is not a backend change.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
8 participants