[clang] [Clang] Diagnose nested inline asm variants (PR #232686)
Oliver Hunt via cfe-commits
cfe-commits at lists.llvm.org
Sun Oct 18 01:11:29 PDT 2026
================
@@ -138,3 +138,7 @@ void test_W(int i) {
// Codegen error
__asm__("" : : "Ws"(i));
}
+
+void test_nested_variants(long num) {
+ __asm__("{{movq $42, %0|}" : "=r"(num)); // expected-error{{nested variants found in inline assembly string}}
----------------
ojhunt wrote:
So this diagnostic talks about nested variants but this testcase looks like it is an unterminated variant going wrong. Can you add tests that cover correctly terminated nested variants as well, so we can be sure that we are not only detecting invalid syntax, etc?
https://github.com/llvm/llvm-project/pull/232686
More information about the cfe-commits
mailing list