mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Deprecated '&' macro arguments.
This commit is contained in:
@@ -9,12 +9,16 @@ fn void main()
|
||||
{
|
||||
Foo* foo;
|
||||
float[<4>] a @align(1) @noinit;
|
||||
float[<4>] b @align(1) @noinit;
|
||||
|
||||
a = *(float[<4>]*)&foo.a;
|
||||
*(float[<4>]*)&foo.a = a;
|
||||
|
||||
a = $$unaligned_load((float[<4>]*)&foo.a, 1);
|
||||
$$unaligned_store((float[<4>]*)&foo.a, a, 1);
|
||||
|
||||
b = @unaligned_load(*(float[<4>]*)&foo.a, 1);
|
||||
@unaligned_store(*(float[<4>]*)&foo.a, b, 1);
|
||||
}
|
||||
|
||||
/* #expect: test.ll
|
||||
@@ -23,6 +27,8 @@ define void @test.main() #0 {
|
||||
entry:
|
||||
%foo = alloca ptr, align 8
|
||||
%a = alloca <4 x float>, align 1
|
||||
%b = alloca <4 x float>, align 1
|
||||
%value = alloca <4 x float>, align 16
|
||||
store ptr null, ptr %foo, align 8
|
||||
%0 = load ptr, ptr %foo, align 8
|
||||
%1 = load <4 x float>, ptr %0, align 16
|
||||
@@ -36,5 +42,13 @@ entry:
|
||||
%6 = load ptr, ptr %foo, align 8
|
||||
%7 = load <4 x float>, ptr %a, align 1
|
||||
store <4 x float> %7, ptr %6, align 1
|
||||
%8 = load ptr, ptr %foo, align 8
|
||||
%9 = load <4 x float>, ptr %8, align 1
|
||||
store <4 x float> %9, ptr %b, align 1
|
||||
%10 = load <4 x float>, ptr %b, align 1
|
||||
store <4 x float> %10, ptr %value, align 16
|
||||
%11 = load ptr, ptr %foo, align 8
|
||||
%12 = load <4 x float>, ptr %value, align 16
|
||||
store <4 x float> %12, ptr %11, align 1
|
||||
ret void
|
||||
}
|
||||
}
|
||||
@@ -31,42 +31,30 @@ define void @test.main() #0 !dbg !8 {
|
||||
entry:
|
||||
%a = alloca i32, align 4
|
||||
%x = alloca i32, align 4
|
||||
%x1 = alloca ptr, align 8
|
||||
%y = alloca i32, align 4
|
||||
%x2 = alloca ptr, align 8
|
||||
%x3 = alloca ptr, align 8
|
||||
%value = alloca i32, align 4
|
||||
%x4 = alloca ptr, align 8
|
||||
%value6 = alloca i32, align 4
|
||||
%value2 = alloca i32, align 4
|
||||
%varargslots = alloca [1 x %any], align 16
|
||||
%retparam = alloca i64, align 8
|
||||
store i32 111, ptr %a, align 4, !dbg !15
|
||||
store ptr %a, ptr %x1, align 8
|
||||
%0 = load ptr, ptr %x1, align 8, !dbg !18
|
||||
%1 = load atomic i32, ptr %0 seq_cst, align 4, !dbg !18
|
||||
store i32 %1, ptr %x, align 4, !dbg !18
|
||||
store ptr %a, ptr %x2, align 8
|
||||
%2 = load ptr, ptr %x2, align 8, !dbg !24
|
||||
%3 = load atomic volatile i32, ptr %2 monotonic, align 4, !dbg !24
|
||||
store i32 %3, ptr %y, align 4, !dbg !24
|
||||
store ptr %a, ptr %x3, align 8
|
||||
%4 = load i32, ptr %x, align 4, !dbg !27
|
||||
%add = add i32 123, %4, !dbg !28
|
||||
%0 = load atomic i32, ptr %a seq_cst, align 4, !dbg !18
|
||||
store i32 %0, ptr %x, align 4, !dbg !18
|
||||
%1 = load atomic volatile i32, ptr %a monotonic, align 4, !dbg !24
|
||||
store i32 %1, ptr %y, align 4, !dbg !24
|
||||
%2 = load i32, ptr %x, align 4, !dbg !27
|
||||
%add = add i32 123, %2, !dbg !28
|
||||
store i32 %add, ptr %value, align 4
|
||||
%5 = load ptr, ptr %x3, align 8, !dbg !29
|
||||
%6 = load i32, ptr %value, align 4, !dbg !29
|
||||
store atomic i32 %6, ptr %5 seq_cst, align 4, !dbg !29
|
||||
store ptr %a, ptr %x4, align 8
|
||||
%7 = load i32, ptr %y, align 4, !dbg !32
|
||||
%add5 = add i32 33, %7, !dbg !33
|
||||
store i32 %add5, ptr %value6, align 4
|
||||
%8 = load ptr, ptr %x4, align 8, !dbg !34
|
||||
%9 = load i32, ptr %value6, align 4, !dbg !34
|
||||
store atomic volatile i32 %9, ptr %8 monotonic, align 4, !dbg !34
|
||||
%10 = insertvalue %any undef, ptr %a, 0, !dbg !37
|
||||
%11 = insertvalue %any %10, i64 ptrtoint (ptr @"$ct.int" to i64), 1, !dbg !37
|
||||
store %any %11, ptr %varargslots, align 16, !dbg !37
|
||||
%12 = call i64 @std.io.printfn(ptr %retparam, ptr @.str, i64 2, ptr %varargslots, i64 1), !dbg !38
|
||||
%3 = load i32, ptr %value, align 4, !dbg !29
|
||||
store atomic i32 %3, ptr %a seq_cst, align 4, !dbg !29
|
||||
%4 = load i32, ptr %y, align 4, !dbg !32
|
||||
%add1 = add i32 33, %4, !dbg !33
|
||||
store i32 %add1, ptr %value2, align 4
|
||||
%5 = load i32, ptr %value2, align 4, !dbg !34
|
||||
store atomic volatile i32 %5, ptr %a monotonic, align 4, !dbg !34
|
||||
%6 = insertvalue %any undef, ptr %a, 0, !dbg !37
|
||||
%7 = insertvalue %any %6, i64 ptrtoint (ptr @"$ct.int" to i64), 1, !dbg !37
|
||||
store %any %7, ptr %varargslots, align 16, !dbg !37
|
||||
%8 = call i64 @std.io.printfn(ptr %retparam, ptr @.str, i64 2, ptr %varargslots, i64 1), !dbg !38
|
||||
ret void, !dbg !38
|
||||
}
|
||||
|
||||
@@ -118,17 +106,17 @@ declare i1 @llvm.expect.i1(i1, i1)
|
||||
!22 = !DILocalVariable(name: "y", scope: !8, file: !7, line: 14, type: !13, align: 4)
|
||||
!23 = !DILocation(line: 14, column: 6, scope: !8)
|
||||
!24 = !DILocation(
|
||||
!25 = distinct !DISubprogram(name: "@atomic_load", linkageName: "@atomic_load", scope: !20, file: !20, line: 225, scopeLine: 225, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !6)
|
||||
!25 = distinct !DISubprogram(name: "@atomic_load", linkageName: "@atomic_load", scope: !20, file: !20
|
||||
!26 = !DILocation(line: 14, column: 10, scope: !8)
|
||||
!27 = !DILocation(line: 15, column: 25, scope: !8)
|
||||
!28 = !DILocation(line: 15, column: 19, scope: !8)
|
||||
!29 = !DILocation(
|
||||
!30 = distinct !DISubprogram(name: "@atomic_store", linkageName: "@atomic_store", scope: !20, file: !20, line: 240, scopeLine: 240, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !6)
|
||||
!30 = distinct !DISubprogram(name: "@atomic_store", linkageName: "@atomic_store", scope: !20, file: !20
|
||||
!31 = !DILocation(line: 15, column: 2, scope: !8)
|
||||
!32 = !DILocation(line: 16, column: 24, scope: !8)
|
||||
!33 = !DILocation(line: 16, column: 19, scope: !8)
|
||||
!34 = !DILocation(
|
||||
!35 = distinct !DISubprogram(name: "@atomic_store", linkageName: "@atomic_store", scope: !20, file: !20, line: 240, scopeLine: 240, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !6)
|
||||
!35 = distinct !DISubprogram(name: "@atomic_store", linkageName: "@atomic_store", scope: !20, file: !20
|
||||
!36 = !DILocation(line: 16, column: 2, scope: !8)
|
||||
!37 = !DILocation(line: 17, column: 20, scope: !8)
|
||||
!38 = !DILocation(line: 17, column: 2, scope: !8)
|
||||
|
||||
@@ -664,7 +664,7 @@ no_match: ; preds = %compare
|
||||
!73 = !DILocalVariable(name: "name", arg: 3, scope: !66, file: !7, line: 33, type: !39)
|
||||
!74 = !DILocation(line: 33, column: 63, scope: !66)
|
||||
!75 = !DILocation(line:
|
||||
!76 = distinct !DISubprogram(name: "new", linkageName: "new", scope: !77, file: !77, line: 624, scopeLine: 624, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !6)
|
||||
!76 = distinct !DISubprogram(name: "new", linkageName: "new", scope: !77, file: !77, line:
|
||||
!77 = !DIFile(filename: "mem.c3"
|
||||
!78 = !DILocation(line: 34, column: 10, scope: !66)
|
||||
!79 = distinct !DISubprogram(name: "test", linkageName: "test.test", scope: !7, file: !7, line: 41, type: !80, scopeLine: 41, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !6, retainedNodes: !21)
|
||||
@@ -743,9 +743,9 @@ no_match: ; preds = %compare
|
||||
!152 = distinct !DISubprogram(name: "alloc_array_try", linkageName: "alloc_array_try", scope: !153, file: !153, line: 284, scopeLine: 284, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !6)
|
||||
!153 = !DIFile(filename: "mem_allocator.c3"
|
||||
!154 = !DILocation
|
||||
!155 = distinct !DISubprogram(name: "alloc_array", linkageName: "alloc_array", scope: !153, file: !153, line: 267, scopeLine: 267, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !6)
|
||||
!155 = distinct !DISubprogram(name: "alloc_array", linkageName: "alloc_array", scope: !153
|
||||
!156 = !DILocation
|
||||
!157 = distinct !DISubprogram(name: "alloc_array", linkageName: "alloc_array", scope: !77, file: !77, line: 710, scopeLine: 710, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !6)
|
||||
!157 = distinct !DISubprogram(name: "alloc_array", linkageName: "alloc_array", scope: !77
|
||||
!158 = !DILocation
|
||||
!159 = !DILocation
|
||||
!160 = !DILocation
|
||||
|
||||
@@ -7,8 +7,6 @@ fn void foo3(bar) { } // #error: Only typed parameters are allowed for functions
|
||||
|
||||
fn void foo4($Type) { } // #error: Only regular parameters are allowed for functions.
|
||||
|
||||
fn void foo8(int* &foo) {} // #error: Only regular parameters are allowed for functions.
|
||||
|
||||
fn void foo9(int x, int x) {} // #error: Duplicate parameter name 'x'.
|
||||
|
||||
macro @foo($a, $b, $c, ...) {}
|
||||
@@ -1,15 +0,0 @@
|
||||
module test;
|
||||
|
||||
fn void test(int* a) {}
|
||||
macro @abc(&self)
|
||||
{
|
||||
test(self); // #error: Implicitly casting 'int**' to 'int*'
|
||||
}
|
||||
|
||||
fn void! test1()
|
||||
{
|
||||
int* a;
|
||||
int b;
|
||||
@abc(a);
|
||||
@abc(b);
|
||||
}
|
||||
@@ -4,17 +4,17 @@ import std::io;
|
||||
|
||||
fn void main()
|
||||
{
|
||||
@boba(;#hash_val, &foo, int $value, $Type)
|
||||
@boba(;#hash_val, #foo, int $value, $Type)
|
||||
{
|
||||
io::printn("Now invoking hash");
|
||||
#hash_val;
|
||||
#hash_val;
|
||||
*foo += $value;
|
||||
#foo += $value;
|
||||
io::printfn("The type was: %s", $Type.nameof);
|
||||
};
|
||||
}
|
||||
|
||||
macro void @boba(;@body(#hash, &foo, $val, $Type))
|
||||
macro void @boba(;@body(#hash, #foo, $val, $Type))
|
||||
{
|
||||
io::printn("Boba");
|
||||
int a = 0;
|
||||
@@ -34,7 +34,6 @@ entry:
|
||||
%error_var8 = alloca i64, align 8
|
||||
%a = alloca i32, align 4
|
||||
%b = alloca i32, align 4
|
||||
%foo = alloca ptr, align 8
|
||||
%len14 = alloca i64, align 8
|
||||
%error_var15 = alloca i64, align 8
|
||||
%retparam17 = alloca i64, align 8
|
||||
@@ -54,17 +53,13 @@ entry:
|
||||
%not_err = icmp eq i64 %1, 0
|
||||
%2 = call i1 @llvm.expect.i1(i1 %not_err, i1 true)
|
||||
br i1 %2, label %after_check, label %assign_optional
|
||||
|
||||
assign_optional: ; preds = %entry
|
||||
store i64 %1, ptr %error_var, align 8
|
||||
br label %guard_block
|
||||
|
||||
after_check: ; preds = %entry
|
||||
br label %noerr_block
|
||||
|
||||
guard_block: ; preds = %assign_optional
|
||||
br label %voiderr
|
||||
|
||||
noerr_block: ; preds = %after_check
|
||||
%3 = load i64, ptr %retparam, align 8
|
||||
store i64 %3, ptr %len, align 8
|
||||
@@ -72,58 +67,44 @@ noerr_block: ; preds = %after_check
|
||||
%not_err3 = icmp eq i64 %4, 0
|
||||
%5 = call i1 @llvm.expect.i1(i1 %not_err3, i1 true)
|
||||
br i1 %5, label %after_check5, label %assign_optional4
|
||||
|
||||
assign_optional4: ; preds = %noerr_block
|
||||
store i64 %4, ptr %error_var2, align 8
|
||||
br label %guard_block6
|
||||
|
||||
after_check5: ; preds = %noerr_block
|
||||
br label %noerr_block7
|
||||
|
||||
guard_block6: ; preds = %assign_optional4
|
||||
br label %voiderr
|
||||
|
||||
noerr_block7: ; preds = %after_check5
|
||||
%6 = call i64 @std.io.File.flush(ptr %0)
|
||||
%not_err9 = icmp eq i64 %6, 0
|
||||
%7 = call i1 @llvm.expect.i1(i1 %not_err9, i1 true)
|
||||
br i1 %7, label %after_check11, label %assign_optional10
|
||||
|
||||
assign_optional10: ; preds = %noerr_block7
|
||||
store i64 %6, ptr %error_var8, align 8
|
||||
br label %guard_block12
|
||||
|
||||
after_check11: ; preds = %noerr_block7
|
||||
br label %noerr_block13
|
||||
|
||||
guard_block12: ; preds = %assign_optional10
|
||||
br label %voiderr
|
||||
|
||||
noerr_block13: ; preds = %after_check11
|
||||
%8 = load i64, ptr %len, align 8
|
||||
%add = add i64 %8, 1
|
||||
br label %voiderr
|
||||
|
||||
voiderr: ; preds = %noerr_block13, %guard_block12, %guard_block6, %guard_block
|
||||
store i32 0, ptr %a, align 4
|
||||
store i32 0, ptr %b, align 4
|
||||
store ptr %b, ptr %foo, align 8
|
||||
%9 = call ptr @std.io.stdout()
|
||||
%10 = call i64 @std.io.File.write(ptr %retparam17, ptr %9, ptr @.str.1, i64 17)
|
||||
%not_err18 = icmp eq i64 %10, 0
|
||||
%11 = call i1 @llvm.expect.i1(i1 %not_err18, i1 true)
|
||||
br i1 %11, label %after_check20, label %assign_optional19
|
||||
|
||||
assign_optional19: ; preds = %voiderr
|
||||
store i64 %10, ptr %error_var15, align 8
|
||||
br label %guard_block21
|
||||
|
||||
after_check20: ; preds = %voiderr
|
||||
br label %noerr_block22
|
||||
|
||||
guard_block21: ; preds = %assign_optional19
|
||||
br label %voiderr36
|
||||
|
||||
noerr_block22: ; preds = %after_check20
|
||||
%12 = load i64, ptr %retparam17, align 8
|
||||
store i64 %12, ptr %len14, align 8
|
||||
@@ -131,38 +112,29 @@ noerr_block22: ; preds = %after_check20
|
||||
%not_err24 = icmp eq i64 %13, 0
|
||||
%14 = call i1 @llvm.expect.i1(i1 %not_err24, i1 true)
|
||||
br i1 %14, label %after_check26, label %assign_optional25
|
||||
|
||||
assign_optional25: ; preds = %noerr_block22
|
||||
store i64 %13, ptr %error_var23, align 8
|
||||
br label %guard_block27
|
||||
|
||||
after_check26: ; preds = %noerr_block22
|
||||
br label %noerr_block28
|
||||
|
||||
guard_block27: ; preds = %assign_optional25
|
||||
br label %voiderr36
|
||||
|
||||
noerr_block28: ; preds = %after_check26
|
||||
%15 = call i64 @std.io.File.flush(ptr %9)
|
||||
%not_err30 = icmp eq i64 %15, 0
|
||||
%16 = call i1 @llvm.expect.i1(i1 %not_err30, i1 true)
|
||||
br i1 %16, label %after_check32, label %assign_optional31
|
||||
|
||||
assign_optional31: ; preds = %noerr_block28
|
||||
store i64 %15, ptr %error_var29, align 8
|
||||
br label %guard_block33
|
||||
|
||||
after_check32: ; preds = %noerr_block28
|
||||
br label %noerr_block34
|
||||
|
||||
guard_block33: ; preds = %assign_optional31
|
||||
br label %voiderr36
|
||||
|
||||
noerr_block34: ; preds = %after_check32
|
||||
%17 = load i64, ptr %len14, align 8
|
||||
%add35 = add i64 %17, 1
|
||||
br label %voiderr36
|
||||
|
||||
voiderr36: ; preds = %noerr_block34, %guard_block33, %guard_block27, %guard_block21
|
||||
%18 = insertvalue %any undef, ptr %a, 0
|
||||
%19 = insertvalue %any %18, i64 ptrtoint (ptr @"$ct.int" to i64), 1
|
||||
@@ -178,18 +150,17 @@ voiderr36: ; preds = %noerr_block34, %gua
|
||||
%25 = load i32, ptr %a, align 4
|
||||
%add45 = add i32 %25, 1
|
||||
store i32 %add45, ptr %a, align 4
|
||||
%26 = load ptr, ptr %foo, align 8
|
||||
%27 = load i32, ptr %26, align 4
|
||||
%add46 = add i32 %27, 3
|
||||
store i32 %add46, ptr %26, align 4
|
||||
%26 = load i32, ptr %b, align 4
|
||||
%add46 = add i32 %26, 3
|
||||
store i32 %add46, ptr %b, align 4
|
||||
store %"char[]" { ptr @.str.5, i64 3 }, ptr %taddr, align 8
|
||||
%28 = insertvalue %any undef, ptr %taddr, 0
|
||||
%29 = insertvalue %any %28, i64 ptrtoint (ptr @"$ct.String" to i64), 1
|
||||
store %any %29, ptr %varargslots47, align 16
|
||||
%30 = call i64 @std.io.printfn(ptr %retparam48, ptr @.str.4, i64 16, ptr %varargslots47, i64 1)
|
||||
%31 = insertvalue %any undef, ptr %b, 0
|
||||
%32 = insertvalue %any %31, i64 ptrtoint (ptr @"$ct.int" to i64), 1
|
||||
store %any %32, ptr %varargslots51, align 16
|
||||
%33 = call i64 @std.io.printfn(ptr %retparam52, ptr @.str.6, i64 2, ptr %varargslots51, i64 1)
|
||||
%27 = insertvalue %any undef, ptr %taddr, 0
|
||||
%28 = insertvalue %any %27, i64 ptrtoint (ptr @"$ct.String" to i64), 1
|
||||
store %any %28, ptr %varargslots47, align 16
|
||||
%29 = call i64 @std.io.printfn(ptr %retparam48, ptr @.str.4, i64 16, ptr %varargslots47, i64 1)
|
||||
%30 = insertvalue %any undef, ptr %b, 0
|
||||
%31 = insertvalue %any %30, i64 ptrtoint (ptr @"$ct.int" to i64), 1
|
||||
store %any %31, ptr %varargslots51, align 16
|
||||
%32 = call i64 @std.io.printfn(ptr %retparam52, ptr @.str.6, i64 2, ptr %varargslots51, i64 1)
|
||||
ret void
|
||||
}
|
||||
|
||||
@@ -2,10 +2,7 @@ macro foo(a, $b, $Type) {}
|
||||
|
||||
macro @foo2(a, $b, $Type) {}
|
||||
|
||||
macro bar(&x) // #error: Ref and expression parameters
|
||||
{}
|
||||
|
||||
macro baz(#y) {} // #error: Ref and expression parameters
|
||||
macro baz(#y) {} // #error: are not allowed in function-like
|
||||
|
||||
macro baz2(a; @body()) {} // #error: Names of macros
|
||||
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
module test;
|
||||
|
||||
import std::io;
|
||||
|
||||
macro @foo(int* &hello)
|
||||
{
|
||||
hello = hello; // #error: You cannot assign to a ref
|
||||
}
|
||||
|
||||
macro @bar(Foo* &f)
|
||||
{
|
||||
f.a = 1;
|
||||
int* x = &f.a;
|
||||
Foo **ff = &f; // #error: You may not take the address
|
||||
}
|
||||
|
||||
struct Foo
|
||||
{
|
||||
int a;
|
||||
}
|
||||
|
||||
fn void main()
|
||||
{
|
||||
int a;
|
||||
@foo(a);
|
||||
Foo x;
|
||||
@bar(x);
|
||||
}
|
||||
@@ -14,10 +14,10 @@ fn int Foo.mutate(Foo *foo)
|
||||
return 10 * ++foo.x;
|
||||
}
|
||||
|
||||
macro @macro_with_body(foo, &x; @body(x, y))
|
||||
macro @macro_with_body(foo, #x; @body(x, y))
|
||||
{
|
||||
*x = foo.x;
|
||||
@body(foo.mutate(), *x);
|
||||
#x = foo.x;
|
||||
@body(foo.mutate(), #x);
|
||||
}
|
||||
|
||||
macro @repeat(int times; @body(x))
|
||||
|
||||
@@ -14,10 +14,10 @@ fn int Foo.mutate(Foo *foo)
|
||||
return 10 * ++foo.x;
|
||||
}
|
||||
|
||||
macro @macro_with_body(foo, &x; @body(x, y))
|
||||
macro @macro_with_body(foo, #x; @body(x, y))
|
||||
{
|
||||
*x = foo.x;
|
||||
@body(foo.mutate(), x); // #error: 'int*' to 'int'
|
||||
#x = foo.x;
|
||||
@body(foo.mutate(), &#x); // #error: 'int*' to 'int'
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@ fn int main() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
macro @foo(&ref) {
|
||||
*ref += 1;
|
||||
macro @foo(#ref) {
|
||||
#ref += 1;
|
||||
}
|
||||
|
||||
/* #expect: test.ll
|
||||
@@ -21,20 +21,34 @@ define i32 @main() #0 {
|
||||
entry:
|
||||
%vec = alloca <4 x i32>, align 16
|
||||
store <4 x i32> zeroinitializer, ptr %vec, align 16
|
||||
%0 = load i32, ptr %vec, align 4
|
||||
%add = add i32 %0, 1
|
||||
store i32 %add, ptr %vec, align 4
|
||||
%ptradd = getelementptr inbounds i8, ptr %vec, i64 8
|
||||
%1 = load i32, ptr %ptradd, align 4
|
||||
%add1 = add i32 %1, 1
|
||||
store i32 %add1, ptr %ptradd, align 4
|
||||
%0 = load <4 x i32>, ptr %vec, align 16
|
||||
%elem = extractelement <4 x i32> %0, i64 0
|
||||
%add = add i32 %elem, 1
|
||||
%elemset = insertelement <4 x i32> %0, i32 %add, i64 0
|
||||
store <4 x i32> %elemset, ptr %vec, align 16
|
||||
%1 = load <4 x i32>, ptr %vec, align 16
|
||||
%elem1 = extractelement <4 x i32> %1, i64 2
|
||||
%add2 = add i32 %elem1, 1
|
||||
%elemset3 = insertelement <4 x i32> %1, i32 %add2, i64 2
|
||||
store <4 x i32> %elemset3, ptr %vec, align 16
|
||||
%2 = load <4 x i32>, ptr %vec, align 16
|
||||
%3 = extractelement <4 x i32> %2, i64 0
|
||||
%eq = icmp eq i32 %3, 1
|
||||
call void @llvm.assume(i1 %eq)
|
||||
%4 = load <4 x i32>, ptr %vec, align 16
|
||||
%5 = extractelement <4 x i32> %4, i64 2
|
||||
%eq2 = icmp eq i32 %5, 1
|
||||
call void @llvm.assume(i1 %eq2)
|
||||
%eq4 = icmp eq i32 %5, 1
|
||||
call void @llvm.assume(i1 %eq4)
|
||||
ret i32 1
|
||||
}
|
||||
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
|
||||
declare void @llvm.assume(i1 noundef) #1
|
||||
attributes #0 = { nounwind uwtable "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
|
||||
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
|
||||
!llvm.module.flags = !{!0, !1, !2, !3, !4, !5}
|
||||
!0 = !{i32 2, !"Dwarf Version", i32 4}
|
||||
!1 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
!2 = !{i32 2, !"wchar_size", i32 4}
|
||||
!3 = !{i32 4, !"PIC Level", i32 2}
|
||||
!4 = !{i32 1, !"uwtable", i32 2}
|
||||
!5 = !{i32 2, !"frame-pointer", i32 2}
|
||||
@@ -4,9 +4,9 @@ import std, test2;
|
||||
|
||||
int[2] x;
|
||||
|
||||
macro @test2(&a = x[1])
|
||||
macro @test2(#a = x[1])
|
||||
{
|
||||
*a = 123;
|
||||
#a = 123;
|
||||
}
|
||||
macro test($Type = int) { io::printn($Type.nameof); }
|
||||
|
||||
@@ -31,9 +31,9 @@ import std;
|
||||
|
||||
int[2] x;
|
||||
|
||||
macro @test2(&a = x[1])
|
||||
macro @test2(#a = x[1])
|
||||
{
|
||||
*a = 12;
|
||||
#a = 12;
|
||||
}
|
||||
macro test($Type = double) { io::printn($Type.nameof); }
|
||||
|
||||
|
||||
@@ -68,4 +68,4 @@ fn usz! TestReader.read(&self, char[] bytes) @dynamic
|
||||
return n;
|
||||
}
|
||||
|
||||
fn char! TestReader.read_byte(&self) @dynamic => io::@read_byte_using_read(self);
|
||||
fn char! TestReader.read_byte(&self) @dynamic => io::read_byte_using_read(self);
|
||||
|
||||
Reference in New Issue
Block a user