SKIP: FAILED



Validation Failure:
#include <metal_stdlib>

using namespace metal;
void textureSampleLevel_ae5e39() {
  float res = arg_0.sample(arg_1, float3(), 1, level(1));
}

vertex void vertex_main() {
  textureSampleLevel_ae5e39();
  return;
}

fragment void fragment_main() {
  textureSampleLevel_ae5e39();
  return;
}

kernel void compute_main() {
  textureSampleLevel_ae5e39();
  return;
}


tint_mqWfoh.metal:5:15: error: use of undeclared identifier 'arg_0'
  float res = arg_0.sample(arg_1, float3(), 1, level(1));
              ^
tint_mqWfoh.metal:5:28: error: use of undeclared identifier 'arg_1'
  float res = arg_0.sample(arg_1, float3(), 1, level(1));
                           ^
2 errors generated.
