forked from ldc-developers/ldc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mainly because opaque IR pointers appear buggy in LLVM 14 (LLVM crashes when compiling druntime).
- Loading branch information
Showing
30 changed files
with
18 additions
and
8,934 deletions.
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
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
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
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
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
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
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
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
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
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
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
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
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
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 |
---|---|---|
@@ -1,48 +1,44 @@ | ||
// https://github.com/ldc-developers/ldc/issues/3692 | ||
|
||
// REQUIRES: target_X86 | ||
// REQUIRES: atmost_llvm1409 | ||
// RUN: %ldc -mtriple=x86_64-linux-gnu -output-ll -of=%t.ll %s | ||
// RUN: FileCheck %s < %t.ll | ||
|
||
|
||
// D `int[3]` rewritten to LL `{ i64, i32 }` for SysV ABI - mismatching size and alignment | ||
// CHECK: define void @_D6gh36924takeFG3iZv({ i64, i32 } %a_arg) | ||
// CHECK-LABEL: define void @_D6gh36924takeFG3iZv({ i64, i32 } %a_arg) | ||
void take(int[3] a) | ||
{ | ||
// the `{ i64, i32 }` size is 16 bytes, so we need a padded alloca (with 8-bytes alignment) | ||
// CHECK-NEXT: %.BaseBitcastABIRewrite_param_storage = alloca { i64, i32 }, align 8 | ||
// CHECK-NEXT: store { i64, i32 } %a_arg, { i64, i32 }* %.BaseBitcastABIRewrite_param_storage | ||
// CHECK-NEXT: %a = bitcast { i64, i32 }* %.BaseBitcastABIRewrite_param_storage to [3 x i32]* | ||
// CHECK-NEXT: = alloca { i64, i32 }, align 8 | ||
} | ||
|
||
// CHECK: define void @_D6gh36924passFZv() | ||
// CHECK-LABEL: define void @_D6gh36924passFZv() | ||
void pass() | ||
{ | ||
// CHECK-NEXT: %arrayliteral = alloca [3 x i32], align 4 | ||
// we need an extra padded alloca with proper alignment | ||
// CHECK-NEXT: %.BaseBitcastABIRewrite_padded_arg_storage = alloca { i64, i32 }, align 8 | ||
// CHECK: %.BaseBitcastABIRewrite_arg = load { i64, i32 }, { i64, i32 }* %.BaseBitcastABIRewrite_padded_arg_storage | ||
// CHECK: %.BaseBitcastABIRewrite_arg = load { i64, i32 }, {{\{ i64, i32 \}\*|ptr}} %.BaseBitcastABIRewrite_padded_arg_storage | ||
take([1, 2, 3]); | ||
} | ||
|
||
|
||
// D `int[4]` rewritten to LL `{ i64, i64 }` for SysV ABI - mismatching alignment only | ||
// CHECK: define void @_D6gh36925take4FG4iZv({ i64, i64 } %a_arg) | ||
// CHECK-LABEL: define void @_D6gh36925take4FG4iZv({ i64, i64 } %a_arg) | ||
void take4(int[4] a) | ||
{ | ||
// the alloca should have 8-bytes alignment, even though a.alignof == 4 | ||
// CHECK-NEXT: %a = alloca [4 x i32], align 8 | ||
// CHECK-NEXT: %1 = bitcast [4 x i32]* %a to { i64, i64 }* | ||
// CHECK-NEXT: store { i64, i64 } %a_arg, { i64, i64 }* %1 | ||
// CHECK: store { i64, i64 } %a_arg, {{\{ i64, i64 \}\*|ptr}} % | ||
} | ||
|
||
// CHECK: define void @_D6gh36925pass4FZv() | ||
// CHECK-LABEL: define void @_D6gh36925pass4FZv() | ||
void pass4() | ||
{ | ||
// CHECK-NEXT: %arrayliteral = alloca [4 x i32], align 4 | ||
// we need an extra alloca with 8-bytes alignment | ||
// CHECK-NEXT: %.BaseBitcastABIRewrite_padded_arg_storage = alloca { i64, i64 }, align 8 | ||
// CHECK: %.BaseBitcastABIRewrite_arg = load { i64, i64 }, { i64, i64 }* %.BaseBitcastABIRewrite_padded_arg_storage | ||
// CHECK: %.BaseBitcastABIRewrite_arg = load { i64, i64 }, {{\{ i64, i64 \}\*|ptr}} %.BaseBitcastABIRewrite_padded_arg_storage | ||
take4([1, 2, 3, 4]); | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.