[PATCH] D107141: [Inline-asm] Add diagnosts for unsupported inline assembly arguments
    Kan Shengchen via Phabricator via cfe-commits 
    cfe-commits at lists.llvm.org
       
    Mon Mar  7 17:33:29 PST 2022
    
    
  
skan added inline comments.
================
Comment at: clang/test/Sema/asm.c:318-346
+typedef struct test19_a {
+  int a;
+  char b;
+} test19_a;
+
+typedef struct test19_b {
+  int a;
----------------
Better to add comments about the size of the struct.
================
Comment at: clang/test/Sema/asm.c:361-362
+  asm ("" : "=rm" (a): "0" (d)); // no-error
+  asm ("" : "=rm" (b): "0" (1)); // expected-error {{impossible constraint in asm: can't store value into a register}}
+  asm ("" : "=rm" (e): "0" (1)); // expected-error {{impossible constraint in asm: can't store value into a register}}
+  asm ("" : "=rm" (x): "0" (e)); // no-error
----------------
Better to comment that we are checking the size is power of 2 here.
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107141/new/
https://reviews.llvm.org/D107141
    
    
More information about the cfe-commits
mailing list