1 ; RUN: opt < %s -inline -S | FileCheck %s 2 ; RUN: opt < %s -passes='cgscc(inline)' -S | FileCheck %s 3 ; Do not inline calls with variable-sized alloca. 4 5 @q = common global i8* null 6 7 define i8* @a(i32 %i) nounwind { 8 ; CHECK-LABEL: define i8* @a 9 entry: 10 %i_addr = alloca i32 11 %retval = alloca i8* 12 %p = alloca i8* 13 %"alloca point" = bitcast i32 0 to i32 14 store i32 %i, i32* %i_addr 15 %0 = load i32, i32* %i_addr, align 4 16 %1 = alloca i8, i32 %0 17 store i8* %1, i8** %p, align 4 18 %2 = load i8*, i8** %p, align 4 19 store i8* %2, i8** @q, align 4 20 br label %return 21 22 return: 23 %retval1 = load i8*, i8** %retval 24 ret i8* %retval1 25 } 26 27 define void @b(i32 %i) nounwind { 28 ; CHECK-LABEL: define void @b 29 entry: 30 %i_addr = alloca i32 31 %"alloca point" = bitcast i32 0 to i32 32 store i32 %i, i32* %i_addr 33 %0 = load i32, i32* %i_addr, align 4 34 %1 = call i8* @a(i32 %0) nounwind 35 ; CHECK: call i8* @a 36 br label %return 37 38 return: 39 ret void 40 } 41