Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lldb/packages/Python/lldbsuite/test/make/Makefile.rules
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,13 @@ ifeq "$(MAKE_GMODULES)" "YES"
CXXFLAGS += $(MANDATORY_MODULE_BUILD_CFLAGS)
endif

# Our files use x86 AT&T assembly throughout.
# Enable it explicitly so any local Clang preference for Intel syntax gets overriden.
ifeq ($(CC_TYPE), clang)
CFLAGS += -mllvm -x86-asm-syntax=att
CXXFLAGS += -mllvm -x86-asm-syntax=att
endif

CFLAGS += $(CFLAGS_EXTRAS)
CXXFLAGS += -std=c++11 $(CFLAGS) $(ARCH_CXXFLAGS)
# Copy common options to the linker flags (dwarf, arch. & etc).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dummy_main.c:

# Assemble .s → .o using the configured compiler.
%.o: %.s
$(CC) -c -x assembler $< -o $@
$(CC) $(CFLAGS) -c -x assembler $< -o $@

# Default target: build all .o fixtures and the dummy exe.
.PHONY: all
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
/* Original C (for context):
* #include <stdio.h>
*
*
* int main(int argc, char **argv) {
* for (int i = 1; i < argc; ++i)
* puts(argv[i]);
* return 0;
* }
*/
.file "d_original_example.c"
.att_syntax
.text
.globl main # -- Begin function main
.p2align 4
Expand Down
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -12,6 +12,7 @@
* }
*/
.file "live_across_call.c"
.att_syntax
.text
.globl live_across_call # -- Begin function live_across_call
.p2align 4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* }
*/
.file "regs_int_params.c"
.att_syntax
.text
.globl regs_int_params # -- Begin function regs_int_params
.p2align 4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*/

.file "seed_reg_const_undef.c"
.att_syntax
.text
.globl main # -- Begin function main
.p2align 4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
# return 0;
# }

.att_syntax
.text
.Ltext0:
.type b, @function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.att_syntax
.text
.file "inlinevar2.c"
.globl other # -- Begin function other
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/Unwind/Inputs/eh-frame-augment-noop.s
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# augmentation machinery should detect that no augmentation is needed and use
# eh_frame directly.

.att_syntax
.text
.globl foo
foo:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.att_syntax
.text
.globl asm_main
asm_main:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.att_syntax
.text
.globl bar
bar:
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/Unwind/Inputs/eh-frame-dwarf-unwind.s
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.att_syntax
.text
.globl bar
bar:
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/Unwind/Inputs/eh-frame-small-fde.s
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.att_syntax
.text

.type bar, @function
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.att_syntax
.cfi_sections .eh_frame, .debug_frame
.text
.globl bar
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.att_syntax
.text
.globl asm_main
asm_main:
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/Unwind/Inputs/trap_frame_sym_ctx.s
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.att_syntax
.text
.globl bar
bar:
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/Unwind/Inputs/unwind-plan-dwarf-dump.s
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.att_syntax
.text
.globl main
.type main, @function
Expand Down
4 changes: 4 additions & 0 deletions lldb/test/Shell/helper/toolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ def use_support_substitutions(config):
# The clang module cache is used for building inferiors.
host_flags += ["-fmodules-cache-path={}".format(config.clang_module_cache)]

# Our files use x86 AT&T assembly throughout.
# Enable it explicitly so any local Clang preference for Intel syntax gets overriden.
host_flags += ["-mllvm", "-x86-asm-syntax=att"]

if config.cmake_sysroot:
host_flags += ["--sysroot={}".format(config.cmake_sysroot)]

Expand Down
Loading