diff options
author | Mike Stump <mrs@apple.com> | 2009-10-29 23:22:14 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-10-29 23:22:14 +0000 |
commit | eb5c92b399715989a9aa36175f2cb8c4939acf33 (patch) | |
tree | c7d65c448cd22faabfdada583edbf65cea11abaa /clang/test | |
parent | 314681a33803350456c6128da31975f17e1755c6 (diff) | |
download | bcm5719-llvm-eb5c92b399715989a9aa36175f2cb8c4939acf33.tar.gz bcm5719-llvm-eb5c92b399715989a9aa36175f2cb8c4939acf33.zip |
Add some more testcases.
llvm-svn: 85534
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/CodeGen/object-size.c | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/clang/test/CodeGen/object-size.c b/clang/test/CodeGen/object-size.c index b6113fa0e5a..fc138e26fde 100644 --- a/clang/test/CodeGen/object-size.c +++ b/clang/test/CodeGen/object-size.c @@ -11,6 +11,7 @@ static char *__inline_strcpy_chk (char *dest, const char *src) { char gbuf[63]; char *gp; +int gi, gj; void test1() { // CHECK: movabsq $59, %rdx @@ -45,17 +46,13 @@ void test4() { } void test5() { + // CHECK: movb $0, %al + // CHECK-NEXT testb %al, %al // CHECK: call ___inline_strcpy_chk strcpy(gp, "Hi there"); } void test6() { - int i; - // CHECK: call ___inline_strcpy_chk - strcpy((++i, gbuf), "Hi there"); -} - -void test7() { char buf[57]; // CHECK: movabsq $53, %rdx @@ -64,3 +61,30 @@ void test7() { // CHECK-NEXT: call ___strcpy_chk strcpy(&buf[4], "Hi there"); } + +void test7() { + int i; + // CHECK-NOT: call ___strcpy_chk + // CHECK: call ___inline_strcpy_chk + strcpy((++i, gbuf), "Hi there"); +} + +void test8() { + char *buf[50]; + // CHECK-NOT: call ___strcpy_chk + // CHECK: call ___inline_strcpy_chk + strcpy(buf[++gi], "Hi there"); +} + +void test9() { + // CHECK-NOT: call ___strcpy_chk + // CHECK: call ___inline_strcpy_chk + strcpy((char *)((++gi) + gj), "Hi there"); +} + +char **p; +void test10() { + // CHECK-NOT: call ___strcpy_chk + // CHECK: call ___inline_strcpy_chk + strcpy(*(++p), "Hi there"); +} |