123 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2;; Check that we accept functions with '$' in the name.3; RUN: llc -mtriple=x86_64 < %s | FileCheck %s4 5;; Check that we accept .Ldsolocal$local: below the function label.6; RUN: llc -mtriple=x86_64 -relocation-model=pic < %s | FileCheck %s --check-prefix=PIC7 8;; Check that we accept .seh_proc below the function label.9; RUN: llc -mtriple=x86_64-windows -relocation-model=pic < %s | FileCheck %s --check-prefix=WIN10 11@gv0 = dso_local global i32 0, align 412@gv1 = dso_preemptable global i32 0, align 413 14define hidden i32 @"_Z54bar$ompvariant$bar"() {15; CHECK-LABEL: _Z54bar$ompvariant$bar:16; CHECK: # %bb.0: # %entry17; CHECK-NEXT: movl $2, %eax18; CHECK-NEXT: retq19;20; PIC-LABEL: _Z54bar$ompvariant$bar:21; PIC: # %bb.0: # %entry22; PIC-NEXT: movl $2, %eax23; PIC-NEXT: retq24;25; WIN-LABEL: _Z54bar$ompvariant$bar:26; WIN: # %bb.0: # %entry27; WIN-NEXT: movl $2, %eax28; WIN-NEXT: retq29entry:30 ret i32 231}32 33define dso_local i32 @dsolocal() {34; CHECK-LABEL: dsolocal:35; CHECK: # %bb.0: # %entry36; CHECK-NEXT: pushq %rax37; CHECK-NEXT: .cfi_def_cfa_offset 1638; CHECK-NEXT: callq ext@PLT39; CHECK-NEXT: movl $2, %eax40; CHECK-NEXT: popq %rcx41; CHECK-NEXT: .cfi_def_cfa_offset 842; CHECK-NEXT: retq43;44; PIC-LABEL: dsolocal:45; PIC: # %bb.0: # %entry46; PIC-NEXT: pushq %rax47; PIC-NEXT: .cfi_def_cfa_offset 1648; PIC-NEXT: callq ext@PLT49; PIC-NEXT: movl $2, %eax50; PIC-NEXT: popq %rcx51; PIC-NEXT: .cfi_def_cfa_offset 852; PIC-NEXT: retq53;54; WIN-LABEL: dsolocal:55; WIN: # %bb.0: # %entry56; WIN-NEXT: subq $40, %rsp57; WIN-NEXT: .seh_stackalloc 4058; WIN-NEXT: .seh_endprologue59; WIN-NEXT: callq ext60; WIN-NEXT: movl $2, %eax61; WIN-NEXT: .seh_startepilogue62; WIN-NEXT: addq $40, %rsp63; WIN-NEXT: .seh_endepilogue64; WIN-NEXT: retq65; WIN-NEXT: .seh_endproc66entry:67 call void @ext()68 ret i32 269}70 71declare void @ext()72 73define i32 @load() {74; CHECK-LABEL: load:75; CHECK: # %bb.0: # %entry76; CHECK-NEXT: movl gv0(%rip), %eax77; CHECK-NEXT: movq gv1@GOTPCREL(%rip), %rcx78; CHECK-NEXT: addl (%rcx), %eax79; CHECK-NEXT: retq80;81; PIC-LABEL: load:82; PIC: # %bb.0: # %entry83; PIC-NEXT: movl .Lgv0$local(%rip), %eax84; PIC-NEXT: movq gv1@GOTPCREL(%rip), %rcx85; PIC-NEXT: addl (%rcx), %eax86; PIC-NEXT: retq87;88; WIN-LABEL: load:89; WIN: # %bb.0: # %entry90; WIN-NEXT: movl gv0(%rip), %eax91; WIN-NEXT: addl gv1(%rip), %eax92; WIN-NEXT: retq93entry:94 %a = load i32, i32* @gv095 %b = load i32, i32* @gv196 %c = add i32 %a, %b97 ret i32 %c98}99 100declare i32 @pers(...)101 102define i32 @eh() personality ptr @pers {103; CHECK-LABEL: eh:104; CHECK: # %bb.0:105; CHECK-NEXT: xorl %eax, %eax106; CHECK-NEXT: retq107;108; PIC-LABEL: eh:109; PIC: # %bb.0:110; PIC-NEXT: xorl %eax, %eax111; PIC-NEXT: retq112;113; WIN-LABEL: eh:114; WIN: # %bb.0:115; WIN-NEXT: xorl %eax, %eax116; WIN-NEXT: retq117; WIN-NEXT: .Lfunc_end0:118; WIN-NEXT: .seh_handlerdata119; WIN-NEXT: .text120; WIN-NEXT: .seh_endproc121 ret i32 0122}123