brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.0 KiB · 5a3ece6 Raw
107 lines · plain
1; RUN: opt < %s -passes=lint -disable-output 2>&1 | FileCheck %s2 3declare void @fn_nothing_i8(i8 %x)4declare void @fn_zeroext(i8 zeroext %x)5declare void @fn_signext(i8 signext %x)6declare void @fn_inreg(i8 inreg %x)7 8declare void @fn_nothing_ptr(ptr %x)9declare void @fn_byval(ptr byval(i8) %x)10declare void @fn_byref(ptr byref(i8) %x)11declare void @fn_inalloca(ptr inalloca(i8) %x)12declare void @fn_preallocated(ptr preallocated(i8) %x)13declare void @fn_sret(ptr sret(i8) %x)14 15define void @caller_zeroext(i8 %x) {16; CHECK: Undefined behavior: ABI attribute zeroext not present on both function and call-site17; CHECK:  call void @fn_zeroext(i8 %x)18  call void @fn_zeroext(i8 %x)19 20; CHECK: Undefined behavior: ABI attribute zeroext not present on both function and call-site21; CHECK:  call void @fn_nothing_i8(i8 zeroext %x)22  call void @fn_nothing_i8(i8 zeroext %x)23  ret void24}25 26define void @caller_signext(i8 %x) {27; CHECK: Undefined behavior: ABI attribute signext not present on both function and call-site28; CHECK:  call void @fn_signext(i8 %x)29  call void @fn_signext(i8 %x)30 31; CHECK: Undefined behavior: ABI attribute signext not present on both function and call-site32; CHECK:  call void @fn_nothing_i8(i8 signext %x)33  call void @fn_nothing_i8(i8 signext %x)34  ret void35}36 37define void @caller_inreg(i8 %x) {38; CHECK: Undefined behavior: ABI attribute inreg not present on both function and call-site39; CHECK:  call void @fn_inreg(i8 %x)40  call void @fn_inreg(i8 %x)41 42; CHECK: Undefined behavior: ABI attribute inreg not present on both function and call-site43; CHECK:  call void @fn_nothing_i8(i8 inreg %x)44  call void @fn_nothing_i8(i8 inreg %x)45  ret void46}47 48define void @caller_byval(ptr %x) {49; CHECK: Undefined behavior: ABI attribute byval not present on both function and call-site50; CHECK:  call void @fn_byval(ptr %x)51  call void @fn_byval(ptr %x)52 53; CHECK: Undefined behavior: ABI attribute byval not present on both function and call-site54; CHECK:  call void @fn_nothing_ptr(ptr byval(i8) %x)55  call void @fn_nothing_ptr(ptr byval(i8) %x)56 57; CHECK: Undefined behavior: ABI attribute byval does not have same argument for function and call-site58; CHECK:  call void @fn_byval(ptr byval(i16) %x)59  call void @fn_byval(ptr byval(i16) %x)60  ret void61}62 63define void @caller_byref(ptr %x) {64; CHECK: Undefined behavior: ABI attribute byref not present on both function and call-site65; CHECK:  call void @fn_byref(ptr %x)66  call void @fn_byref(ptr %x)67 68; CHECK: Undefined behavior: ABI attribute byref not present on both function and call-site69; CHECK:  call void @fn_nothing_ptr(ptr byref(i8) %x)70  call void @fn_nothing_ptr(ptr byref(i8) %x)71 72; CHECK: Undefined behavior: ABI attribute byref does not have same argument for function and call-site73; CHECK:  call void @fn_byref(ptr byref(i16) %x)74  call void @fn_byref(ptr byref(i16) %x)75  ret void76}77 78define void @caller_inalloca(ptr %x) {79; CHECK: Undefined behavior: ABI attribute inalloca not present on both function and call-site80; CHECK:  call void @fn_inalloca(ptr %x)81  call void @fn_inalloca(ptr %x)82 83; CHECK: Undefined behavior: ABI attribute inalloca not present on both function and call-site84; CHECK:  call void @fn_nothing_ptr(ptr inalloca(i8) %x)85  call void @fn_nothing_ptr(ptr inalloca(i8) %x)86 87; CHECK: Undefined behavior: ABI attribute inalloca does not have same argument for function and call-site88; CHECK:  call void @fn_inalloca(ptr inalloca(i16) %x)89  call void @fn_inalloca(ptr inalloca(i16) %x)90  ret void91}92 93define void @caller_sret(ptr %x) {94; CHECK: Undefined behavior: ABI attribute sret not present on both function and call-site95; CHECK:  call void @fn_sret(ptr %x)96  call void @fn_sret(ptr %x)97 98; CHECK: Undefined behavior: ABI attribute sret not present on both function and call-site99; CHECK:  call void @fn_nothing_ptr(ptr sret(i8) %x)100  call void @fn_nothing_ptr(ptr sret(i8) %x)101 102; CHECK: Undefined behavior: ABI attribute sret does not have same argument for function and call-site103; CHECK:  call void @fn_sret(ptr sret(i16) %x)104  call void @fn_sret(ptr sret(i16) %x)105  ret void106}107