forked from ldc-developers/ldc
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8d551f7
commit 3591a77
Showing
5 changed files
with
94 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// RUN: %ldc -c -output-ll -of=%t.ll %s | ||
|
||
struct TraceBuf { | ||
align(1) uint args; | ||
} | ||
|
||
// Test correct compilation (no error) of the context pointer type for the delegate of `foo`. | ||
void foo() { | ||
byte[2] fixDescs; | ||
TraceBuf fixLog; | ||
|
||
auto dlg = delegate() { | ||
fixDescs[0] = 1; | ||
fixLog.args = 1; | ||
}; | ||
} | ||
|
||
class TraceClass { | ||
align(1) | ||
uint args; | ||
} | ||
|
||
// Test correct compilation (no error) of the context pointer type for the delegate of `foo2`. | ||
void foo2() { | ||
byte[2] fixDescs; | ||
scope TraceClass fixLog; | ||
|
||
auto dlg = delegate() { | ||
fixDescs[0] = 1; | ||
fixLog.args = 1; | ||
}; | ||
} |
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,20 @@ | ||
// RUN: %ldc -c %s | ||
|
||
align(1) struct Item { | ||
KV v; | ||
uint i; | ||
} | ||
|
||
struct KV { | ||
align(1) S* s; | ||
uint k; | ||
} | ||
|
||
struct S { | ||
Table table; | ||
} | ||
|
||
struct Table { | ||
char a; | ||
Item v; | ||
} |