[Issue 12833] New: switch statement does not work properly when -inline used
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sun Jun 1 00:48:19 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=12833
Issue ID: 12833
Summary: switch statement does not work properly when -inline
used
Product: D
Version: D2
Hardware: x86_64
OS: Windows
Status: NEW
Keywords: wrong-code
Severity: major
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: jiki at red.email.ne.jp
The following code does not work properly with -inline -- the program finishes
silently.
I tested on DMD2.065, git-head, and DMD1.076.
CODE:
import std.stdio;
ushort HIWORD(long x) { return cast(ushort)((x >> 16) & 0xFFFF); }
void test(int a)
{
switch (HIWORD(a)) {
case 1:
writefln("it works!"); // this makes no output if -inline used
break;
default:
}
}
void main()
{
test(0x1_0000);
}
COMMAND:
dmd -inline -m32 -run test.d
ENVIRONMENT:
Windows 7 64-bit
--
More information about the Digitalmars-d-bugs
mailing list