This is an archive of the discontinued LLVM Phabricator instance.

Upstream an MS inline assembly test from Mozilla's inline assembly code
ClosedPublic

Authored by ehsan on Jul 14 2014, 8:35 PM.

Details

Summary

I'm planning on upstreaming some test cases for the inline assembly
usage in the Mozilla code base. A lot of these test cases test the
recent fixes to this code.

Diff Detail

Repository
rL LLVM

Event Timeline

ehsan updated this revision to Diff 11416.Jul 14 2014, 8:35 PM
ehsan retitled this revision from to Upstream an MS inline assembly test from Mozilla's inline assembly code.
ehsan updated this object.
ehsan edited the test plan for this revision. (Show Details)
ehsan added a reviewer: rnk.
ehsan added a subscriber: Unknown Object (MLST).
rnk edited edge metadata.Jul 16 2014, 3:27 PM

I'm in favor of more tests like this. Please commit with some minor touch ups.

Going forward, I wonder if we can test this on the LLVM side by adding some kind of utility that parses a .test file with some "inline assembly" in a dirt simple language that mostly consists of canned lookup results. Then we could actually test the Intel inline assembly parser changes in LLVM instead of in Clang. Right now it's completely untestable.

test/CodeGen/mozilla-ms-inline-asm.c
10 ↗(On Diff #11416)

Most of these LLVM IR value names are elided in a no-asserts (NDEBUG) build. You can approximate this effect without doing a complete release build and test cycle by piping the IR through 'opt -strip -S' before FileCheck.

18 ↗(On Diff #11416)

I would wildcard most of the string literal contents. The only thing worth testing is the instructions that got rewritten and the constraints. Maybe some CHECK lines like:

// CHECK: call void asm sideeffect inteldialect
// CHECK: mov edx,dword ptr $1
// CHECK: mov ecx,dword ptr $2
// CHECK: mov eax,dword ptr $3
// CHECK: call dword ptr[edx+eax*$$4]
// CHECK: "=*m,*m,*m,*m,~{eax},~{ebp},~{ecx},~{edx},~{flags},~{esp},~{dirflag},~{fpsr},~{flags}"
// CHECK: (i8** %params.addr, i32* %paramCount.addr, i8** %that.addr, i32* %methodIndex.addr)
ehsan closed this revision.Jul 17 2014, 4:47 AM
ehsan updated this revision to Diff 11569.

Closed by commit rL213255 (authored by @ehsan).