diff options
author | Devang Patel <dpatel@apple.com> | 2010-05-14 21:04:45 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-05-14 21:04:45 +0000 |
commit | 552b888744c4f70703c29659188c628eecefc908 (patch) | |
tree | d279e21d697d3523ad4d8d4936386bfaf6d69496 /test/FrontendC/2010-05-14-Optimized-VarType.c | |
parent | 71ea4e5b05924c25000013f3b6d6be4946a77a18 (diff) | |
download | external_llvm-552b888744c4f70703c29659188c628eecefc908.zip external_llvm-552b888744c4f70703c29659188c628eecefc908.tar.gz external_llvm-552b888744c4f70703c29659188c628eecefc908.tar.bz2 |
Test case for r103800.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103801 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/FrontendC/2010-05-14-Optimized-VarType.c')
-rw-r--r-- | test/FrontendC/2010-05-14-Optimized-VarType.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/FrontendC/2010-05-14-Optimized-VarType.c b/test/FrontendC/2010-05-14-Optimized-VarType.c new file mode 100644 index 0000000..2aa85b5 --- /dev/null +++ b/test/FrontendC/2010-05-14-Optimized-VarType.c @@ -0,0 +1,23 @@ +// RUN: %llvmgcc %s -Os -S -g -o - | grep DW_TAG_structure_type | count 1 +// Variable 'a' is optimized but the debug info should preserve its type info. +#include <stdlib.h> + +struct foo { + int Attribute; +}; + +void *getfoo(void) __attribute__((noinline)); + +void *getfoo(void) +{ + int *x = malloc(sizeof(int)); + *x = 42; + return (void *)x; +} + +int main(int argc, char *argv[]) { + struct foo *a = (struct foo *)getfoo(); + + return a->Attribute; +} + |