1 ; RUN: llvm-dis < %s.bc| FileCheck %s 2 3 ; vaArgIntrinsic.3.2.ll.bc was generated by passing this file to llvm-as-3.2. 4 ; The test checks that LLVM does not misread variable argument intrinsic instructions 5 ; of older bitcode files. 6 7 define i32 @varArgIntrinsic(i32 %X, ...) { 8 9 %ap = alloca i8* 10 %ap2 = bitcast i8** %ap to i8* 11 12 ; CHECK: call void @llvm.va_start(i8* %ap2) 13 call void @llvm.va_start(i8* %ap2) 14 15 ; CHECK-NEXT: %tmp = va_arg i8** %ap, i32 16 %tmp = va_arg i8** %ap, i32 17 18 %aq = alloca i8* 19 %aq2 = bitcast i8** %aq to i8* 20 21 ; CHECK: call void @llvm.va_copy(i8* %aq2, i8* %ap2) 22 call void @llvm.va_copy(i8* %aq2, i8* %ap2) 23 ; CHECK-NEXT: call void @llvm.va_end(i8* %aq2) 24 call void @llvm.va_end(i8* %aq2) 25 26 ; CHECK-NEXT: call void @llvm.va_end(i8* %ap2) 27 call void @llvm.va_end(i8* %ap2) 28 ret i32 %tmp 29 } 30 31 declare void @llvm.va_start(i8*) 32 declare void @llvm.va_copy(i8*, i8*) 33 declare void @llvm.va_end(i8*)