-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add snapshot test for mux call with strings
- Loading branch information
Showing
2 changed files
with
72 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
...sty__codegen__tests__expression_tests__builtin_function_call_mux_with_aggregate_type.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
source: src/codegen/tests/expression_tests.rs | ||
expression: result | ||
--- | ||
; ModuleID = 'main' | ||
source_filename = "main" | ||
|
||
%main = type { [81 x i8] } | ||
|
||
@main_instance = global %main zeroinitializer | ||
@utf08_literal_0 = private unnamed_addr constant [6 x i8] c"dolor\00" | ||
@utf08_literal_1 = private unnamed_addr constant [6 x i8] c"ipsum\00" | ||
@utf08_literal_2 = private unnamed_addr constant [6 x i8] c"lorem\00" | ||
@utf08_literal_3 = private unnamed_addr constant [4 x i8] c"sit\00" | ||
|
||
define void @main(%main* %0) { | ||
entry: | ||
%str1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 | ||
%1 = alloca [81 x i8], align 1 | ||
switch i32 3, label %continue_block [ | ||
i32 0, label %2 | ||
i32 1, label %4 | ||
i32 2, label %6 | ||
i32 3, label %8 | ||
] | ||
|
||
2: ; preds = %entry | ||
%3 = bitcast [81 x i8]* %1 to i8* | ||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %3, i8* align 1 getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_2, i32 0, i32 0), i32 6, i1 false) | ||
br label %continue_block | ||
|
||
4: ; preds = %entry | ||
%5 = bitcast [81 x i8]* %1 to i8* | ||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %5, i8* align 1 getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_1, i32 0, i32 0), i32 6, i1 false) | ||
br label %continue_block | ||
|
||
6: ; preds = %entry | ||
%7 = bitcast [81 x i8]* %1 to i8* | ||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %7, i8* align 1 getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_0, i32 0, i32 0), i32 6, i1 false) | ||
br label %continue_block | ||
|
||
8: ; preds = %entry | ||
%9 = bitcast [81 x i8]* %1 to i8* | ||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %9, i8* align 1 getelementptr inbounds ([4 x i8], [4 x i8]* @utf08_literal_3, i32 0, i32 0), i32 4, i1 false) | ||
br label %continue_block | ||
|
||
continue_block: ; preds = %entry, %8, %6, %4, %2 | ||
%10 = bitcast [81 x i8]* %str1 to i8* | ||
%11 = bitcast [81 x i8]* %1 to i8* | ||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %10, i8* align 1 %11, i32 80, i1 false) | ||
ret void | ||
} | ||
|
||
; Function Attrs: argmemonly nofree nounwind willreturn | ||
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #0 | ||
|
||
attributes #0 = { argmemonly nofree nounwind willreturn } |