mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Compiler segfault when using distinct type in attribute imported from other module #2234.
This commit is contained in:
23
test/test_suite/attributes/attribute_no_infer_type.c3t
Normal file
23
test/test_suite/attributes/attribute_no_infer_type.c3t
Normal file
@@ -0,0 +1,23 @@
|
||||
module test;
|
||||
import other;
|
||||
|
||||
struct Foo @Attr(0) {int x;}
|
||||
|
||||
fn void main()
|
||||
{
|
||||
Foo x;
|
||||
}
|
||||
module other;
|
||||
typedef MyInt = int;
|
||||
attrdef @Attr(MyInt x);
|
||||
|
||||
/* #expect: test.ll
|
||||
|
||||
@"$ct.test.Foo" = linkonce global %.introspect { i8 9, i64 0, ptr null, i64 4, i64 0, i64 1, [0 x i64] zeroinitializer }, align 8
|
||||
|
||||
define void @test.main() #0 {
|
||||
entry:
|
||||
%x = alloca %Foo, align 4
|
||||
store i32 0, ptr %x, align 4
|
||||
ret void
|
||||
}
|
||||
Reference in New Issue
Block a user