From: Chad Rosier Date: Mon, 25 Jul 2011 19:00:00 +0000 (+0000) Subject: Rename an alignment test to be more precise and add another test for the default X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=33abf4ed29594fa6af530def2a93a2bb69ab8863;p=clang Rename an alignment test to be more precise and add another test for the default ABI. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135934 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Sema/align-arm-apcs-gnu.c b/test/Sema/align-arm-apcs-gnu.c new file mode 100644 index 0000000000..6628b0c830 --- /dev/null +++ b/test/Sema/align-arm-apcs-gnu.c @@ -0,0 +1,16 @@ +// RUN: %clang_cc1 -triple arm-unknown-unknown -target-abi apcs-gnu -fsyntax-only -verify %s + +struct s0 { double f0; int f1; }; +char chk0[__alignof__(struct s0) == 4 ? 1 : -1]; + +double g1; +short chk1[__alignof__(g1) == 4 ? 1 : -1]; +short chk2[__alignof__(double) == 4 ? 1 : -1]; + +long long g2; +short chk1[__alignof__(g2) == 4 ? 1 : -1]; +short chk2[__alignof__(long long) == 4 ? 1 : -1]; + +_Complex double g3; +short chk1[__alignof__(g3) == 4 ? 1 : -1]; +short chk2[__alignof__(_Complex double) == 4 ? 1 : -1]; diff --git a/test/Sema/align-arm-apcs.c b/test/Sema/align-arm-apcs.c deleted file mode 100644 index 0a5d3fe921..0000000000 --- a/test/Sema/align-arm-apcs.c +++ /dev/null @@ -1,4 +0,0 @@ -// RUN: %clang_cc1 -triple arm-unknown-unknown -target-abi apcs-gnu -fsyntax-only -verify %s - -struct s0 { double f0; int f1; }; -char chk0[__alignof__(struct s0) == 4 ? 1 : -1]; diff --git a/test/Sema/align-arm.c b/test/Sema/align-arm.c new file mode 100644 index 0000000000..68eb44d7b0 --- /dev/null +++ b/test/Sema/align-arm.c @@ -0,0 +1,13 @@ +// RUN: %clang_cc1 -triple armv7-apple-darwin10 -fsyntax-only -verify %s + +double g1; +short chk1[__alignof__(g1) == 8 ? 1 : -1]; +short chk2[__alignof__(double) == 8 ? 1 : -1]; + +long long g2; +short chk1[__alignof__(g2) == 8 ? 1 : -1]; +short chk2[__alignof__(long long) == 8 ? 1 : -1]; + +_Complex double g3; +short chk1[__alignof__(g3) == 8 ? 1 : -1]; +short chk2[__alignof__(_Complex double) == 8 ? 1 : -1];