reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
   76
   77
   78
   79
   80
   81
   82
   83
   84
   85
   86
   87
# Source (tiny.cc):
#   void a() {}
#   void b() {}
#   int main(int argc, char** argv) {
#     void(*ptr)();
#     if (argc == 1)
#       ptr = &a;
#     else
#       ptr = &b;
#     ptr();
#   }
# Compile with:
#    clang++ tiny.cc -S -o tiny.s

  .text
  .file "tiny.cc"
  .globl  _Z1av                   # -- Begin function _Z1av
  .p2align  4, 0x90
  .type _Z1av,@function
_Z1av:                                  # @_Z1av
  .cfi_startproc
# %bb.0:
  pushq %rbp
  .cfi_def_cfa_offset 16
  .cfi_offset %rbp, -16
  movq  %rsp, %rbp
  .cfi_def_cfa_register %rbp
  popq  %rbp
  retq
.Lfunc_end0:
  .size _Z1av, .Lfunc_end0-_Z1av
  .cfi_endproc
                                        # -- End function
  .globl  _Z1bv                   # -- Begin function _Z1bv
  .p2align  4, 0x90
  .type _Z1bv,@function
_Z1bv:                                  # @_Z1bv
  .cfi_startproc
# %bb.0:
  pushq %rbp
  .cfi_def_cfa_offset 16
  .cfi_offset %rbp, -16
  movq  %rsp, %rbp
  .cfi_def_cfa_register %rbp
  popq  %rbp
  retq
.Lfunc_end1:
  .size _Z1bv, .Lfunc_end1-_Z1bv
  .cfi_endproc
                                        # -- End function
  .globl  main                    # -- Begin function main
  .p2align  4, 0x90
  .type main,@function
main:                                   # @main
  .cfi_startproc
# %bb.0:
  pushq %rbp
  .cfi_def_cfa_offset 16
  .cfi_offset %rbp, -16
  movq  %rsp, %rbp
  .cfi_def_cfa_register %rbp
  subq  $32, %rsp
  movl  $0, -4(%rbp)
  movl  %edi, -8(%rbp)
  movq  %rsi, -16(%rbp)
  cmpl  $1, -8(%rbp)
  jne .LBB2_2
# %bb.1:
  movabsq $_Z1av, %rax
  movq  %rax, -24(%rbp)
  jmp .LBB2_3
.LBB2_2:
  movabsq $_Z1bv, %rax
  movq  %rax, -24(%rbp)
.LBB2_3:
  callq *-24(%rbp)
  movl  -4(%rbp), %eax
  addq  $32, %rsp
  popq  %rbp
  retq
.Lfunc_end2:
  .size main, .Lfunc_end2-main
  .cfi_endproc
                                        # -- End function

  .ident  "clang version 6.0.0 (trunk 316774)"
  .section  ".note.GNU-stack","",@progbits