Debian Codegraph @

gcc/testsuite/gdc.test/compilable/test20990.d

raw
1 // REQUIRED_ARGS: -O
2 // https://issues.dlang.org/show_bug.cgi?id=20990
3
4 // foo() and bar() should produce the same code when
5 // optimized.
6
7 void foo(int* ptr)
8 {
9 if (ptr is null)
10 assert(false);
11 *ptr = 42;
12 }
13
14 void bar(int* ptr)
15 {
16 assert(ptr);
17 *ptr = 42;
18 }