47 lines · plain
1; RUN: llc %s -o - -filetype=obj --mcpu=znver2 | llvm-objdump -dr - | FileCheck %s2; RUN: llc %s -o - -filetype=asm --mcpu=znver2 | llvm-mc - -o - --mcpu=znver2 -filetype=obj -triple x86_64-unknown-linux-gnu | llvm-objdump -dr - | FileCheck %s3; RUN: llc %s -o - -filetype=asm --mcpu=znver2 | FileCheck %s --check-prefix=ASM4 5;; Check that we produce a push, then an align-to-16-bytes p2align.6;7; ASM: # %bb.0:8; ASM-NEXT: pushq %rax9; ASM-NEXT: .cfi_def_cfa_offset 1610; ASM-NEXT: .p2align 4{{$}}11 12;; When we assemble the file, either using the built-in asssembler or going13;; via a textual assembly file, we should get the same padding between the14;; initial push and the next block for alignment. It's a single 15 byte15;; nop.16 17; CHECK: 0: 5018; CHECK-NEXT: 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 nopw %cs:(%rax,%rax)19 20;; Note that we specify a CPU to ensure the same nop patterns are selected21;; between llvm-mc and llc, just in case defaults changed, which one isn't22;; important.23 24target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"25target triple = "x86_64-unknown-linux-gnu"26 27; Function Attrs: noreturn nounwind uwtable28define dso_local void @b() local_unnamed_addr {29entry:30 br label %for.cond31 32for.cond:33 tail call void (...) @a()34 br label %for.cond35}36 37declare void @a(...) local_unnamed_addr38 39!llvm.module.flags = !{!0, !1, !2, !3}40!llvm.ident = !{!4}41 42!0 = !{i32 1, !"wchar_size", i32 4}43!1 = !{i32 8, !"PIC Level", i32 2}44!2 = !{i32 7, !"PIE Level", i32 2}45!3 = !{i32 7, !"uwtable", i32 2}46!4 = !{!"clang"}47