Mercurial > projects > ldc
view tests/mini/arrays8.d @ 951:e71c61befd6d
Now that we're using LLVM 2.5, we can stop always running the
CFGSimplification pass.
The pass was originally added as a workaround for a LLVM 2.4 bug where debug
info would reference labels that have been optimized away.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Thu, 12 Feb 2009 18:39:03 +0100 |
parents | 1bb99290e03a |
children |
line wrap: on
line source
module arrays8; extern(C) int printf(char*, ...); void main() { char[] a = "hello "; printf(" \"%s\".length = %u\n", a.ptr, a.length); char[] b = "world"; printf(" \"%s\".length = %u\n", b.ptr, b.length); char[] c = a ~ b; printf("After 'a ~ b':\n"); printf(" \"%.*s\".length = %u\n", a.length, a.ptr, a.length); printf(" \"%.*s\".length = %u\n", b.length, b.ptr, b.length); printf(" \"%.*s\".length = %u\n", c.length, c.ptr, c.length); assert(c.length == a.length + b.length); assert(c !is a); assert(c !is b); }