52 lines · plain
1// Check printing with --mlir-elide-resource-strings-if-larger elides printing large resources2 3// RUN: mlir-opt %s --mlir-elide-resource-strings-if-larger=20| FileCheck %s4 5// RUN: mlir-opt %s --mlir-elide-resource-strings-if-larger=0| FileCheck %s --check-prefix=ZERO6 7 8// To ensure we print the resource keys, have reference to them9// CHECK: attr = dense_resource<blob1> : tensor<3xi64>10// ZERO: attr = dense_resource<blob1> : tensor<3xi64>11"test.blob1op"() {attr = dense_resource<blob1> : tensor<3xi64> } : () -> ()12 13// CHECK-NEXT: attr = dense_resource<blob2> : tensor<3xi64>14// ZERO-NEXT: attr = dense_resource<blob2> : tensor<3xi64>15"test.blob2op"() {attr = dense_resource<blob2> : tensor<3xi64> } : () -> ()16 17// CHECK: {-#18// CHECK-NEXT: external_resources: {19// CHECK-NEXT: external: {20// CHECK-NEXT: "backslash\\tab\09": true,21// CHECK-NEXT: string: "\22string\22"22// CHECK-NEXT: },23// CHECK-NEXT: other_stuff: {24// CHECK-NEXT: bool: true25// CHECK-NEXT: }26// CHECK-NEXT: }27// CHECK-NEXT: #-}28 29// Make sure no external_resources are printed when --mlir-elide-resource-strings-if-larger=030// ZERO: {-#31// ZERO-EMPTY:32// ZERO-NEXT: #-}33 34{-#35 dialect_resources: {36 builtin: {37 blob1: "0x08000000010000000000000002000000000000000300000000000000",38 blob2: "0x08000000040000000000000005000000000000000600000000000000"39 }40 },41 external_resources: {42 external: {43 blob: "0x08000000010000000000000002000000000000000300000000000000",44 "backslash\\tab\09": true, // quoted key with escape characters45 string: "\"string\"" // string with escape characters46 },47 other_stuff: {48 bool: true49 }50 }51#-}52