<p dir="ltr">You should then split the test in 2. One uses llc and checks the generated assembly for the desired expression. </p>
<p dir="ltr">The other uses llvm-mc to test that a given expression produces the desired relocation. </p>
<p dir="ltr">Please *never* use llc with binary output in a test unless you are testing a code path that really can't be reached otherwise. </p>
<div class="gmail_quote">On May 26, 2015 12:31 PM, "Andy Ayers" <<a href="mailto:andya@microsoft.com">andya@microsoft.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">We want to ensure that the bitcode expressions are properly simplified so that when assembled they produce the expected relocations.<br>
<br>
-----Original Message-----<br>
From: Rafael EspĂ­ndola [mailto:<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>]<br>
Sent: Monday, May 25, 2015 5:26 AM<br>
To: Andy Ayers<br>
Cc: llvm-commits<br>
Subject: Re: [llvm] r237327 - Don't omit the constant when computing a cross-section relative relocation.<br>
<br>
> +; Verify the assembler produces the expected expressions ; RUN: llc<br>
> +-mtriple=x86_64-pc-win32 %s -o - | FileCheck %s ; Verify the .fix<br>
> +data section conveys the right offsets and the right relocations ;<br>
> +RUN: llc -mtriple=x86_64-pc-win32 -filetype=obj %s -o - |<br>
> +llvm-readobj -relocations -expand-relocs -sections -section-data |<br>
> +FileCheck %s --check-prefix=READOBJ<br>
<br>
Can't this be tested with llvm-mc instead of llc?<br>
<br>
Cheers,<br>
Rafael<br>
</blockquote></div>