OLD | NEW |
(Empty) | |
| 1 ; Show that we check parameter types of a function call against paramter types |
| 2 ; of called function. |
| 3 |
| 4 ; REQUIRES: no_minimal_build |
| 5 |
| 6 ; RUN: not %pnacl_sz -bitcode-as-text %p/Inputs/call-fcn-bad-param-type.tbc \ |
| 7 ; RUN: -bitcode-format=pnacl -notranslate -build-on-read \ |
| 8 ; RUN: -allow-externally-defined-symbols 2>&1 \ |
| 9 ; RUN: | FileCheck %s |
| 10 |
| 11 ; RUN: pnacl-bcfuzz -bitcode-as-text -output - \ |
| 12 ; RUN: %p/Inputs/call-fcn-bad-param-type.tbc \ |
| 13 ; RUN: | not pnacl-bcdis -no-records | FileCheck %s --check-prefix=DIS |
| 14 |
| 15 ; DIS: module { // BlockID = 8 |
| 16 ; DIS-NEXT: version 1; |
| 17 ; DIS-NEXT: types { // BlockID = 17 |
| 18 ; DIS-NEXT: count 5; |
| 19 ; DIS-NEXT: @t0 = void; |
| 20 ; DIS-NEXT: @t1 = i32; |
| 21 ; DIS-NEXT: @t2 = i8; |
| 22 ; DIS-NEXT: @t3 = void (i32); |
| 23 ; DIS-NEXT: @t4 = void (); |
| 24 ; DIS-NEXT: } |
| 25 ; DIS-NEXT: declare external void @f0(i32); |
| 26 ; DIS-NEXT: define external void @f1(); |
| 27 ; DIS-NEXT: globals { // BlockID = 19 |
| 28 ; DIS-NEXT: count 0; |
| 29 ; DIS-NEXT: } |
| 30 ; DIS-NEXT: valuesymtab { // BlockID = 14 |
| 31 ; DIS-NEXT: @f1 : "Test"; |
| 32 ; DIS-NEXT: @f0 : "f"; |
| 33 ; DIS-NEXT: } |
| 34 ; DIS-NEXT: function void @f1() { // BlockID = 12 |
| 35 ; DIS-NEXT: blocks 1; |
| 36 ; DIS-NEXT: constants { // BlockID = 11 |
| 37 ; DIS-NEXT: i32: |
| 38 ; DIS-NEXT: %c0 = i32 1; |
| 39 ; DIS-NEXT: i8: |
| 40 ; DIS-NEXT: %c1 = i8 1; |
| 41 ; DIS-NEXT: } |
| 42 ; DIS-NEXT: %b0: |
| 43 ; DIS-NEXT: %v0 = add i8 %c1, %c1; |
| 44 ; DIS-NEXT: call void @f0(i8 %c1); |
| 45 ; DIS-NEXT: Error({{.*}}): Parameter 1 mismatch: i8 and i32 |
| 46 ; CHECK: Argument 1 of f expects i32. Found: i8 |
| 47 ; DIS-NEXT: ret void; |
| 48 ; DIS-NEXT: } |
| 49 ; DIS-NEXT: } |
| 50 |
| 51 |
| 52 |
| 53 |
OLD | NEW |