Home | History | Annotate | Download | only in GlobalOpt
      1 ; RUN: opt < %s -globalopt -S | FileCheck %s
      2 
      3 define internal i32 @f(i32* %m) {
      4 ; CHECK-LABEL: define internal fastcc i32 @f
      5   %v = load i32* %m
      6   ret i32 %v
      7 }
      8 
      9 define internal x86_thiscallcc i32 @g(i32* %m) {
     10 ; CHECK-LABEL: define internal fastcc i32 @g
     11   %v = load i32* %m
     12   ret i32 %v
     13 }
     14 
     15 ; Leave this one alone, because the user went out of their way to request this
     16 ; convention.
     17 define internal coldcc i32 @h(i32* %m) {
     18 ; CHECK-LABEL: define internal coldcc i32 @h
     19   %v = load i32* %m
     20   ret i32 %v
     21 }
     22 
     23 define internal i32 @j(i32* %m) {
     24 ; CHECK-LABEL: define internal i32 @j
     25   %v = load i32* %m
     26   ret i32 %v
     27 }
     28 
     29 define void @call_things() {
     30   %m = alloca i32
     31   call i32 @f(i32* %m)
     32   call x86_thiscallcc i32 @g(i32* %m)
     33   call coldcc i32 @h(i32* %m)
     34   call i32 @j(i32* %m)
     35   ret void
     36 }
     37 
     38 @llvm.used = appending global [1 x i8*] [
     39    i8* bitcast (i32(i32*)* @j to i8*)
     40 ], section "llvm.metadata"
     41 
     42 ; CHECK-LABEL: define void @call_things()
     43 ; CHECK: call fastcc i32 @f
     44 ; CHECK: call fastcc i32 @g
     45 ; CHECK: call coldcc i32 @h
     46 ; CHECK: call i32 @j
     47