-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[NFCI][lldb][test][asm] Enable AT&T syntax explicitly #166770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Implementation files using the Intel syntax typically explicitly specify it. Do the same for the few files using AT&T syntax. This enables building LLVM with `-mllvm -x86-asm-syntax=intel` in one's Clang config files (i.e. a global preference for Intel syntax).
|
@llvm/pr-subscribers-lldb Author: Raul Tambre (tambry) ChangesImplementation files using the Intel syntax typically explicitly specify it. Do the same for the few files using AT&T syntax. This enables building LLVM with Full diff: https://github.com/llvm/llvm-project/pull/166770.diff 20 Files Affected:
diff --git a/lldb/test/API/functionalities/disassembler-variables/d_original_example.s b/lldb/test/API/functionalities/disassembler-variables/d_original_example.s
index c38742cfc683e..8824d4c81fa2c 100644
--- a/lldb/test/API/functionalities/disassembler-variables/d_original_example.s
+++ b/lldb/test/API/functionalities/disassembler-variables/d_original_example.s
@@ -1,6 +1,6 @@
/* Original C (for context):
* #include <stdio.h>
-*
+*
* int main(int argc, char **argv) {
* for (int i = 1; i < argc; ++i)
* puts(argv[i]);
@@ -8,6 +8,7 @@
* }
*/
.file "d_original_example.c"
+ .att_syntax
.text
.globl main # -- Begin function main
.p2align 4
diff --git a/lldb/test/API/functionalities/disassembler-variables/live_across_call.s b/lldb/test/API/functionalities/disassembler-variables/live_across_call.s
index cd9f08afe6fdc..4bdf68cbbebb4 100644
--- a/lldb/test/API/functionalities/disassembler-variables/live_across_call.s
+++ b/lldb/test/API/functionalities/disassembler-variables/live_across_call.s
@@ -1,7 +1,7 @@
/* Original C (for context):
* // Declare a real external call so the compiler must respect ABI clobbers.
* extern int leaf(int) __attribute__((noinline));
-*
+*
* __attribute__((noinline))
* int live_across_call(int x) {
* volatile int a = x; // a starts in a GPR (from arg)
@@ -12,6 +12,7 @@
* }
*/
.file "live_across_call.c"
+ .att_syntax
.text
.globl live_across_call # -- Begin function live_across_call
.p2align 4
diff --git a/lldb/test/API/functionalities/disassembler-variables/loop_reg_rotate.s b/lldb/test/API/functionalities/disassembler-variables/loop_reg_rotate.s
index c01e2b28fd2be..c35116551baab 100644
--- a/lldb/test/API/functionalities/disassembler-variables/loop_reg_rotate.s
+++ b/lldb/test/API/functionalities/disassembler-variables/loop_reg_rotate.s
@@ -3,7 +3,7 @@
* int loop_reg_rotate(int n, int seed) {
* volatile int acc = seed; // keep as a named local
* int i = 0, j = 1, k = 2; // extra pressure but not enough to spill
-*
+*
* for (int t = 0; t < n; ++t) {
* // Mix uses so the allocator may reshuffle regs for 'acc'
* acc = acc + i;
@@ -13,12 +13,13 @@
* acc = acc + k;
* i ^= acc; j += acc; k ^= j;
* }
-*
+*
* asm volatile("" :: "r"(acc));
* return acc + i + j + k;
* }
*/
.file "loop_reg_rotate.c"
+ .att_syntax
.text
.globl loop_reg_rotate # -- Begin function loop_reg_rotate
.p2align 4
diff --git a/lldb/test/API/functionalities/disassembler-variables/regs_fp_params.s b/lldb/test/API/functionalities/disassembler-variables/regs_fp_params.s
index 502ab151e0c5b..86863d4902357 100644
--- a/lldb/test/API/functionalities/disassembler-variables/regs_fp_params.s
+++ b/lldb/test/API/functionalities/disassembler-variables/regs_fp_params.s
@@ -5,6 +5,7 @@
* return a + b + c + d + e + f;
* }*/
.file "regs_fp_params.c"
+ .att_syntax
.text
.globl regs_fp_params # -- Begin function regs_fp_params
.p2align 4
diff --git a/lldb/test/API/functionalities/disassembler-variables/regs_int_params.s b/lldb/test/API/functionalities/disassembler-variables/regs_int_params.s
index 0b2a60e2b4d5f..c44e3c3d85558 100644
--- a/lldb/test/API/functionalities/disassembler-variables/regs_int_params.s
+++ b/lldb/test/API/functionalities/disassembler-variables/regs_int_params.s
@@ -8,6 +8,7 @@
* }
*/
.file "regs_int_params.c"
+ .att_syntax
.text
.globl regs_int_params # -- Begin function regs_int_params
.p2align 4
diff --git a/lldb/test/API/functionalities/disassembler-variables/regs_mixed_params.s b/lldb/test/API/functionalities/disassembler-variables/regs_mixed_params.s
index 691180b42f249..1c25af1f570ee 100644
--- a/lldb/test/API/functionalities/disassembler-variables/regs_mixed_params.s
+++ b/lldb/test/API/functionalities/disassembler-variables/regs_mixed_params.s
@@ -11,6 +11,7 @@
*/
.file "regs_mixed_params.c"
.file 0 "." "regs_mixed_params.c" md5 0x73c4bda40238ae460aaecb3a6a2603cf
+ .att_syntax
.text
.globl regs_mixed_params # -- Begin function regs_mixed_params
.p2align 4
diff --git a/lldb/test/API/functionalities/disassembler-variables/seed_reg_const_undef.s b/lldb/test/API/functionalities/disassembler-variables/seed_reg_const_undef.s
index f85b8a712cbb2..4e3d64d57cd13 100644
--- a/lldb/test/API/functionalities/disassembler-variables/seed_reg_const_undef.s
+++ b/lldb/test/API/functionalities/disassembler-variables/seed_reg_const_undef.s
@@ -10,6 +10,7 @@
*/
.file "seed_reg_const_undef.c"
+ .att_syntax
.text
.globl main # -- Begin function main
.p2align 4
diff --git a/lldb/test/Shell/SymbolFile/DWARF/x86/DW_TAG_GNU_call_site-DW_AT_low_pc.s b/lldb/test/Shell/SymbolFile/DWARF/x86/DW_TAG_GNU_call_site-DW_AT_low_pc.s
index c6e5ccda5f2ef..24a64bdd5aa67 100644
--- a/lldb/test/Shell/SymbolFile/DWARF/x86/DW_TAG_GNU_call_site-DW_AT_low_pc.s
+++ b/lldb/test/Shell/SymbolFile/DWARF/x86/DW_TAG_GNU_call_site-DW_AT_low_pc.s
@@ -27,6 +27,7 @@
# return 0;
# }
+ .att_syntax
.text
.Ltext0:
.type b, @function
diff --git a/lldb/test/Shell/SymbolFile/DWARF/x86/DW_TAG_variable-DW_AT_decl_file-DW_AT_abstract_origin-crosscu1.s b/lldb/test/Shell/SymbolFile/DWARF/x86/DW_TAG_variable-DW_AT_decl_file-DW_AT_abstract_origin-crosscu1.s
index e64cd176c6302..7c583f6bf59c4 100644
--- a/lldb/test/Shell/SymbolFile/DWARF/x86/DW_TAG_variable-DW_AT_decl_file-DW_AT_abstract_origin-crosscu1.s
+++ b/lldb/test/Shell/SymbolFile/DWARF/x86/DW_TAG_variable-DW_AT_decl_file-DW_AT_abstract_origin-crosscu1.s
@@ -24,6 +24,7 @@
# CHECK: inlinevar.h:2: (int) var = {{.*}}
# Unfixed LLDB did show only: (int) var = {{.*}}
+ .att_syntax
.text
.file "inlinevar1.c"
.file 1 "" "./inlinevarother.h"
diff --git a/lldb/test/Shell/SymbolFile/DWARF/x86/Inputs/DW_TAG_variable-DW_AT_decl_file-DW_AT_abstract_origin-crosscu2.s b/lldb/test/Shell/SymbolFile/DWARF/x86/Inputs/DW_TAG_variable-DW_AT_decl_file-DW_AT_abstract_origin-crosscu2.s
index 6a8dfa3eb63f3..6758a900f9b90 100644
--- a/lldb/test/Shell/SymbolFile/DWARF/x86/Inputs/DW_TAG_variable-DW_AT_decl_file-DW_AT_abstract_origin-crosscu2.s
+++ b/lldb/test/Shell/SymbolFile/DWARF/x86/Inputs/DW_TAG_variable-DW_AT_decl_file-DW_AT_abstract_origin-crosscu2.s
@@ -1,3 +1,4 @@
+ .att_syntax
.text
.file "inlinevar2.c"
.globl other # -- Begin function other
diff --git a/lldb/test/Shell/Unwind/Inputs/basic-block-sections-with-dwarf.s b/lldb/test/Shell/Unwind/Inputs/basic-block-sections-with-dwarf.s
index a7b5431a7afaf..d89366c15eca9 100644
--- a/lldb/test/Shell/Unwind/Inputs/basic-block-sections-with-dwarf.s
+++ b/lldb/test/Shell/Unwind/Inputs/basic-block-sections-with-dwarf.s
@@ -8,6 +8,7 @@
# using the frame pointer register and the are deliberately adjusting the stack
# pointer to test that we're using the correct unwind row.
+ .att_syntax
.text
.type baz,@function
diff --git a/lldb/test/Shell/Unwind/Inputs/eh-frame-augment-noop.s b/lldb/test/Shell/Unwind/Inputs/eh-frame-augment-noop.s
index 2bcf534f04fcf..cb2f8358bac9b 100644
--- a/lldb/test/Shell/Unwind/Inputs/eh-frame-augment-noop.s
+++ b/lldb/test/Shell/Unwind/Inputs/eh-frame-augment-noop.s
@@ -2,6 +2,7 @@
# augmentation machinery should detect that no augmentation is needed and use
# eh_frame directly.
+ .att_syntax
.text
.globl foo
foo:
diff --git a/lldb/test/Shell/Unwind/Inputs/eh-frame-dwarf-unwind-abort.s b/lldb/test/Shell/Unwind/Inputs/eh-frame-dwarf-unwind-abort.s
index 95099ce42d3f5..670c97e5dd0bf 100644
--- a/lldb/test/Shell/Unwind/Inputs/eh-frame-dwarf-unwind-abort.s
+++ b/lldb/test/Shell/Unwind/Inputs/eh-frame-dwarf-unwind-abort.s
@@ -1,3 +1,4 @@
+ .att_syntax
.text
.globl asm_main
asm_main:
diff --git a/lldb/test/Shell/Unwind/Inputs/eh-frame-dwarf-unwind-val-offset.s b/lldb/test/Shell/Unwind/Inputs/eh-frame-dwarf-unwind-val-offset.s
index 273921cc9c549..2ec991033e262 100644
--- a/lldb/test/Shell/Unwind/Inputs/eh-frame-dwarf-unwind-val-offset.s
+++ b/lldb/test/Shell/Unwind/Inputs/eh-frame-dwarf-unwind-val-offset.s
@@ -1,3 +1,4 @@
+ .att_syntax
.text
.globl bar
bar:
diff --git a/lldb/test/Shell/Unwind/Inputs/eh-frame-dwarf-unwind.s b/lldb/test/Shell/Unwind/Inputs/eh-frame-dwarf-unwind.s
index d83551483dd31..dd0b5de7004df 100644
--- a/lldb/test/Shell/Unwind/Inputs/eh-frame-dwarf-unwind.s
+++ b/lldb/test/Shell/Unwind/Inputs/eh-frame-dwarf-unwind.s
@@ -1,3 +1,4 @@
+ .att_syntax
.text
.globl bar
bar:
diff --git a/lldb/test/Shell/Unwind/Inputs/eh-frame-small-fde.s b/lldb/test/Shell/Unwind/Inputs/eh-frame-small-fde.s
index 29decefad5e51..71782601b3c53 100644
--- a/lldb/test/Shell/Unwind/Inputs/eh-frame-small-fde.s
+++ b/lldb/test/Shell/Unwind/Inputs/eh-frame-small-fde.s
@@ -1,3 +1,4 @@
+ .att_syntax
.text
.type bar, @function
diff --git a/lldb/test/Shell/Unwind/Inputs/prefer-debug-over-eh-frame.s b/lldb/test/Shell/Unwind/Inputs/prefer-debug-over-eh-frame.s
index c9b7a785c3410..29f65fe4afbc2 100644
--- a/lldb/test/Shell/Unwind/Inputs/prefer-debug-over-eh-frame.s
+++ b/lldb/test/Shell/Unwind/Inputs/prefer-debug-over-eh-frame.s
@@ -1,3 +1,4 @@
+ .att_syntax
.cfi_sections .eh_frame, .debug_frame
.text
.globl bar
diff --git a/lldb/test/Shell/Unwind/Inputs/thread-step-out-ret-addr-check.s b/lldb/test/Shell/Unwind/Inputs/thread-step-out-ret-addr-check.s
index dd4453c64b88a..1ef46bd5d2460 100644
--- a/lldb/test/Shell/Unwind/Inputs/thread-step-out-ret-addr-check.s
+++ b/lldb/test/Shell/Unwind/Inputs/thread-step-out-ret-addr-check.s
@@ -1,3 +1,4 @@
+ .att_syntax
.text
.globl asm_main
asm_main:
diff --git a/lldb/test/Shell/Unwind/Inputs/trap_frame_sym_ctx.s b/lldb/test/Shell/Unwind/Inputs/trap_frame_sym_ctx.s
index 50ede2d34d38d..f35a60b7e809e 100644
--- a/lldb/test/Shell/Unwind/Inputs/trap_frame_sym_ctx.s
+++ b/lldb/test/Shell/Unwind/Inputs/trap_frame_sym_ctx.s
@@ -1,3 +1,4 @@
+ .att_syntax
.text
.globl bar
bar:
diff --git a/lldb/test/Shell/Unwind/Inputs/unwind-plan-dwarf-dump.s b/lldb/test/Shell/Unwind/Inputs/unwind-plan-dwarf-dump.s
index 6030affd09d20..d3ec4fd8fa41d 100644
--- a/lldb/test/Shell/Unwind/Inputs/unwind-plan-dwarf-dump.s
+++ b/lldb/test/Shell/Unwind/Inputs/unwind-plan-dwarf-dump.s
@@ -1,3 +1,4 @@
+ .att_syntax
.text
.globl main
.type main, @function
|
|
Gentle ping. |
|
Presumably these tests are all hand-written assembly, and not something generated by the compiler and checked in? If it's the latter, we should find a way to prevent this from regressing. Is there a public facing bot that builds with |
|
Half are generated using a compiler per the comments and the rest of unknown provenance. I'd wager the rest are also mostly compiler generated and then hand reduced and modified but lack the comments mentioning such. #167234 would/will solve the issue going forward for future compiler-assisted generated testcases unless someone takes care to remove the directive. There are no bots running this configuration. An alternative would be passing I don't imagine there are many cases making it into LLVM either as overall there are a few 10s of cases total across LLVM that gave gathered over the the few decades. So it might be just not worth bothering and me fixing these once a year or so when they come up (if #167234 doesn't get merged and reduce even that trickle). |
Implementation files using the Intel syntax typically explicitly specify it. Do the same for the few files using AT&T syntax.
This enables building LLVM with
-mllvm -x86-asm-syntax=intelin one's Clang config files (i.e. a global preference for Intel syntax).