| OLD | NEW |
| 1 ; RUN: pnacl-abicheck < %s | FileCheck %s | 1 ; RUN: pnacl-abicheck < %s | FileCheck %s |
| 2 ; Test type-checking in function bodies. This test is not intended to verify | 2 ; Test type-checking in function bodies. This test is not intended to verify |
| 3 ; all the rules about the various types, but instead to make sure that types | 3 ; all the rules about the various types, but instead to make sure that types |
| 4 ; stashed in various places in function bodies are caught. | 4 ; stashed in various places in function bodies are caught. |
| 5 | 5 |
| 6 @a2 = private global i17 zeroinitializer | 6 @a2 = private global i17 zeroinitializer |
| 7 declare void @func(i15 %arg) | 7 declare void @func(i15 %arg) |
| 8 | 8 |
| 9 !llvm.foo = !{!0} | 9 !llvm.foo = !{!0} |
| 10 !0 = metadata !{ half 0.0} | 10 !0 = metadata !{ half 0.0} |
| 11 | 11 |
| 12 define void @types() { | 12 define void @types() { |
| 13 ; CHECK: Function types has instruction with disallowed type: half | 13 ; CHECK: Function types has instruction with disallowed type: half |
| 14 %h1 = fptrunc double undef to half | 14 %h1 = fptrunc double undef to half |
| 15 ; CHECK: Function types has instruction operand with disallowed type: half | 15 ; CHECK: Function types has instruction operand with disallowed type: half |
| 16 %h2 = bitcast half 0.0 to i16 | 16 %h2 = bitcast half 0.0 to i16 |
| 17 ; see below... | 17 ; see below... |
| 18 %h3 = fadd double 0.0, fpext (half 0.0 to double) | 18 %h3 = fadd double 0.0, fpext (half 0.0 to double) |
| 19 | 19 |
| 20 ; TODO(mseaborn): Re-enable integer size checking. | 20 ; CHECK: Function types has instruction operand with disallowed type: i17* |
| 21 ; See https://code.google.com/p/nativeclient/issues/detail?id=3360 | 21 store i32 0, i32* bitcast (i17* @a2 to i32*), align 4 |
| 22 ; C;HECK: Function types has instruction operand with disallowed type: i17* | 22 ; CHECK: Function types has instruction operand with disallowed type: i15 |
| 23 ; store i32 0, i32* bitcast (i17* @a2 to i32*), align 4 | 23 call void @func(i15 1) |
| 24 ; C;HECK: Function types has instruction operand with disallowed type: i15 | |
| 25 ; call void @func(i15 1) | |
| 26 | 24 |
| 27 ; CHECK: Function types has disallowed instruction metadata: !foo | 25 ; CHECK: Function types has disallowed instruction metadata: !foo |
| 28 ret void, !foo !0 | 26 ret void, !foo !0 |
| 29 } | 27 } |
| 30 ; CHECK-NOT: disallowed | 28 ; CHECK-NOT: disallowed |
| 31 | 29 |
| 32 | 30 |
| 33 ; TODO: | 31 ; TODO: |
| 34 ; the bitcode reader seems to expand some operations inline | 32 ; the bitcode reader seems to expand some operations inline |
| 35 ; (e.g. fpext, sext, uitofp) such that doing something like | 33 ; (e.g. fpext, sext, uitofp) such that doing something like |
| 36 ; %h3 = fadd double 0.0, fpext (half 0.0 to double) | 34 ; %h3 = fadd double 0.0, fpext (half 0.0 to double) |
| 37 ; means the verifier pass will never see the fpext or its operands | 35 ; means the verifier pass will never see the fpext or its operands |
| OLD | NEW |