45 lines · plain
1// RUN: mlir-opt %s | mlir-opt -verify-diagnostics | FileCheck %s2 3//////////////4// Tests the types in the 'Test' dialect, not the ones in 'typedefs.mlir'5 6// CHECK: @simpleA(%arg0: !test.smpla)7func.func @simpleA(%A : !test.smpla) -> () {8 return9}10 11// CHECK: @compoundA(%arg0: !test.cmpnd_a<1, !test.smpla, [5, 6]>)12func.func @compoundA(%A : !test.cmpnd_a<1, !test.smpla, [5, 6]>)-> () {13 return14}15 16// CHECK: @compoundNested(%arg0: !test.cmpnd_nested_outer<i <42 <1, !test.smpla, [5, 6]>>>)17func.func @compoundNested(%arg0: !test.cmpnd_nested_outer<i <42 <1, !test.smpla, [5, 6]>>>) -> () {18 return19}20 21// Same as above, but we're parsing the complete spec for the inner type22// CHECK: @compoundNestedExplicit(%arg0: !test.cmpnd_nested_outer<i <42 <1, !test.smpla, [5, 6]>>>)23func.func @compoundNestedExplicit(%arg0: !test.cmpnd_nested_outer<i !test.cmpnd_inner<42 <1, !test.smpla, [5, 6]>>>) -> () {24// Verify that the type prefix is elided and optional25// CHECK: format_cpmd_nested_type %arg0 nested <i <42 <1, !test.smpla, [5, 6]>>>26// CHECK: format_cpmd_nested_type %arg0 nested <i <42 <1, !test.smpla, [5, 6]>>>27 test.format_cpmd_nested_type %arg0 nested !test.cmpnd_nested_outer<i !test.cmpnd_inner<42 <1, !test.smpla, [5, 6]>>>28 test.format_cpmd_nested_type %arg0 nested <i <42 <1, !test.smpla, [5, 6]>>>29 return30}31 32// CHECK-LABEL: @compoundNestedQual33// CHECK-SAME: !test.cmpnd_nested_outer_qual<i !test.cmpnd_inner<42 <1, !test.smpla, [5, 6]>>>34func.func private @compoundNestedQual(%arg0: !test.cmpnd_nested_outer_qual<i !test.cmpnd_inner<42 <1, !test.smpla, [5, 6]>>>) -> ()35 36// CHECK: @testInt(%arg0: !test.int<signed, 8>, %arg1: !test.int<unsigned, 2>, %arg2: !test.int<none, 1>)37func.func @testInt(%A : !test.int<s, 8>, %B : !test.int<unsigned, 2>, %C : !test.int<n, 1>) {38 return39}40 41// CHECK: @structTest(%arg0: !test.struct<{field1,!test.smpla}, {field2,!test.int<none, 3>}>)42func.func @structTest (%A : !test.struct< {field1, !test.smpla}, {field2, !test.int<none, 3>} > ) {43 return44}45