brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · c5bc606 Raw
43 lines · plain
1// RUN: mlir-opt %s -verify-diagnostics --split-input-file2 3module {4  // expected-error@+1 {{expected a constant initializer for this operator}}5  wasmssa.global @illegal i32 mutable : {6    %0 = wasmssa.const 17: i327    %1 = wasmssa.const 35: i328    %2 = wasmssa.add %0 %1 : i329    wasmssa.return %2 : i3210  }11}12 13// -----14 15module {16  wasmssa.import_global "glob" from "my_module" as @global_0 mutable : i3217  wasmssa.global @global_1 i32 : {18  // expected-error@+1 {{global.get op is considered constant if it's referring to a import.global symbol marked non-mutable}}19    %0 = wasmssa.global_get @global_0 : i3220    wasmssa.return %0 : i3221  }22}23 24// -----25 26module {27  wasmssa.global @global_1 i32 : {28  // expected-error@+1 {{symbol @glarble is undefined}}29    %0 = wasmssa.global_get @glarble : i3230    wasmssa.return %0 : i3231  }32}33 34// -----35 36module {37  // expected-error@+1 {{expecting either `exported` or symbol name. got exproted}}38  wasmssa.global exproted @global_1 i32 : {39    %0 = wasmssa.const 17 : i3240    wasmssa.return %0 : i3241  }42}43