This is an archive of the discontinued LLVM Phabricator instance.

[Assembler] Inline assembly diagnostics test.
AbandonedPublic

Authored by sanwou01 on Feb 9 2017, 9:45 AM.

Details

Summary

Add a test for improved inline assembly diagnostics in llvm.

Event Timeline

sanwou01 created this revision.Feb 9 2017, 9:45 AM

This tests the improved inline asm diagnostics from D29769.

rnk added inline comments.Feb 9 2017, 9:58 AM
test/Misc/inline-asm-diags.c
2

Use clang -cc1 -S -o /dev/null -verify to test this.

echristo edited edge metadata.Feb 9 2017, 3:56 PM

Can we not get llc to use the diags interfaces here?

sanwou01 updated this revision to Diff 88188.Feb 13 2017, 5:54 AM

Use clang_cc1 -verify for testing as suggested by @rnk.

@echristo, llc does use the same diags interfaces as clang, however, it is
lacking the infrastructure to make use of LocCookies.

In any case, I think this test is useful to prevent regressions in inline
assembly diagnostics in clang.

sanwou01 marked an inline comment as done.Feb 13 2017, 5:55 AM

Use clang_cc1 -verify for testing as suggested by @rnk.

@echristo, llc does use the same diags interfaces as clang, however, it is
lacking the infrastructure to make use of LocCookies.

In any case, I think this test is useful to prevent regressions in inline
assembly diagnostics in clang.

The point is that we typically do not want end to end tests (of which this is one) in clang if there's any way to avoid it. In this case we could test the same interfaces by adding support to llc for them (and it would arguably be useful in llc mode anyhow).

grosbach edited edge metadata.Feb 13 2017, 9:00 AM

Eric is correct. These tests would be more suitable in llc. The clang tests should check that the inline asm is inserted into the IR in the correct form if there's any difference pre and post patch (I don't think there is?).

sanwou01 abandoned this revision.Feb 20 2017, 7:17 AM

Please see D30167 for an attempt to test this from llc.