File tree 2 files changed +13
-1
lines changed
compiler/rustc_llvm/llvm-wrapper
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -436,7 +436,8 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
436
436
Options.FunctionSections = FunctionSections;
437
437
Options.UniqueSectionNames = UniqueSectionNames;
438
438
Options.MCOptions .AsmVerbose = AsmComments;
439
- Options.MCOptions .PreserveAsmComments = AsmComments;
439
+ // Always preserve comments that were written by the user
440
+ Options.MCOptions .PreserveAsmComments = true ;
440
441
Options.MCOptions .ABIName = ABIStr;
441
442
if (SplitDwarfFile) {
442
443
Options.MCOptions .SplitDwarfFile = SplitDwarfFile;
Original file line number Diff line number Diff line change
1
+ //@ assembly-output: emit-asm
2
+ // Check that comments in assembly get passed
3
+
4
+ #![ crate_type = "lib" ]
5
+
6
+ // CHECK-LABEL: test_comments:
7
+ #[ no_mangle]
8
+ pub fn test_comments ( ) {
9
+ // CHECK: example comment
10
+ unsafe { core:: arch:: asm!( "nop // example comment" ) } ;
11
+ }
You can’t perform that action at this time.
0 commit comments