Skip to content

Commit cf679e4

Browse files
committed
Force code generation in assembly generation smoke-tests
In llvm/llvm-project@7b23f41 , `.text` started being suppressed from LLVM assembly in cases where it wasn't strictly necessary. Currently, the sample functions in these two tests are frequently decided to be IR-only functions, resulting in no code generation, so LLVM drops the `.text` directive. Adding `#[no_mangle]` forces these tests back to their original intent - assembly code is generated, and so a `.text` directive is generated as well.
1 parent 6c8347b commit cf679e4

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Diff for: tests/assembly/targets/targets-elf.rs

+2
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,8 @@
676676
#[lang = "sized"]
677677
trait Sized {}
678678

679+
// Force linkage to ensure code is actually generated
680+
#[no_mangle]
679681
pub fn test() -> u8 {
680682
42
681683
}

Diff for: tests/assembly/targets/targets-macho.rs

+2
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@
8383
#[lang = "sized"]
8484
trait Sized {}
8585

86+
// Force linkage to ensure code is actually generated
87+
#[no_mangle]
8688
pub fn test() -> u8 {
8789
42
8890
}

0 commit comments

Comments
 (0)