// A `#foreign` ref must name something real (PLAN-C C3.1): `nosuchunit` // names neither a #library constant nor a named `#import c` unit, so // this is a compile-time diagnostic — a typo'd ref previously compiled // and resolved silently through whatever image carried the symbol. // Regression (PLAN-C C0.2b xfail, flipped by C3.1). #import "modules/std.sx"; refs :: #import c { #source "1620-cimport-foreign-ref-unvalidated/ref.c"; }; ref_answer :: () -> i32 #foreign nosuchunit "ref_answer"; main :: () -> i32 { print("ref = {}\n", ref_answer()); 0 }