OLD | NEW |
(Empty) | |
| 1 ; RUN: not pnacl-abicheck < %s | FileCheck %s |
| 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 |
| 4 ; stashed in various places in function bodies are caught. |
| 5 |
| 6 @a2 = private global i17 zeroinitializer |
| 7 |
| 8 ; CHECK: Function func has disallowed type: void (i15) |
| 9 declare void @func(i15 %arg) |
| 10 |
| 11 !llvm.foo = !{!0} |
| 12 !0 = metadata !{ half 0.0} |
| 13 |
| 14 define void @types() { |
| 15 ; CHECK: bad result type: {{.*}} fptrunc |
| 16 %h1 = fptrunc double undef to half |
| 17 |
| 18 ; CHECK: bad operand: {{.*}} bitcast half |
| 19 %h2 = bitcast half 0.0 to i16 |
| 20 |
| 21 ; see below... |
| 22 %h3 = fadd double 0.0, fpext (half 0.0 to double) |
| 23 |
| 24 ; CHECK: bad pointer: store |
| 25 store i32 0, i32* bitcast (i17* @a2 to i32*), align 1 |
| 26 |
| 27 ; CHECK: bad function callee operand: call void @func(i15 1) |
| 28 call void @func(i15 1) |
| 29 |
| 30 ; CHECK: Function types has disallowed instruction metadata: !foo |
| 31 ret void, !foo !0 |
| 32 } |
| 33 ; CHECK-NOT: disallowed |
| 34 |
| 35 |
| 36 ; TODO: |
| 37 ; the bitcode reader seems to expand some operations inline |
| 38 ; (e.g. fpext, sext, uitofp) such that doing something like |
| 39 ; %h3 = fadd double 0.0, fpext (half 0.0 to double) |
| 40 ; means the verifier pass will never see the fpext or its operands |
OLD | NEW |