[mlir][test] Fix -Wformat in sparse_tensor.c (NFC)

llvm-project/mlir/test/CAPI/sparse_tensor.c:50:43:
error: format specifies type 'unsigned long long' but the argument has type 'MlirSparseTensorLevelType' (aka 'unsigned long') [-Werror,-Wformat]
    fprintf(stderr, "level_type: %llu\n", lvlTypes[l]);
                                 ~~~~     ^~~~~~~~~~~
                                 %lu
1 error generated.
This commit is contained in:
Jie Fu
2024-02-06 10:44:52 +08:00
parent 5953532615
commit 87ff65b07c

View File

@@ -14,6 +14,7 @@
#include "mlir-c/RegisterEverything.h"
#include <assert.h>
#include <inttypes.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
@@ -47,7 +48,7 @@ static int testRoundtripEncoding(MlirContext ctx) {
malloc(sizeof(MlirSparseTensorLevelType) * lvlRank);
for (int l = 0; l < lvlRank; ++l) {
lvlTypes[l] = mlirSparseTensorEncodingAttrGetLvlType(originalAttr, l);
fprintf(stderr, "level_type: %llu\n", lvlTypes[l]);
fprintf(stderr, "level_type: %" PRIu64 "\n", lvlTypes[l]);
}
// CHECK: posWidth: 32
int posWidth = mlirSparseTensorEncodingAttrGetPosWidth(originalAttr);