Skip to content
Snippets Groups Projects
Commit 6e403408 authored by Sunil Srivastava's avatar Sunil Srivastava
Browse files

Implementation of PS4 ABI, Round 1

Added a test to safeguard linux ABI.

Differential Revision: http://reviews.llvm.org/D16607


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259095 91177308-0d34-0410-b5e6-96231b3b80d8
parent 22ffb44c
No related branches found
No related tags found
No related merge requests found
// RUN: %clang_cc1 %s -fsyntax-only -verify -triple=i686-apple-darwin9 // RUN: %clang_cc1 %s -fsyntax-only -verify -triple=i686-apple-darwin9
// RUN: %clang_cc1 %s -fsyntax-only -verify -triple=arm-linux-gnueabihf // RUN: %clang_cc1 %s -fsyntax-only -verify -triple=arm-linux-gnueabihf
// RUN: %clang_cc1 %s -fsyntax-only -verify -triple=aarch64-linux-gnu // RUN: %clang_cc1 %s -fsyntax-only -verify -triple=aarch64-linux-gnu
// RUN: %clang_cc1 %s -fsyntax-only -verify -triple=x86_64-pc-linux-gnu
// expected-no-diagnostics // expected-no-diagnostics
#include <stddef.h> #include <stddef.h>
...@@ -190,7 +191,7 @@ struct g11 { ...@@ -190,7 +191,7 @@ struct g11 {
__attribute__((aligned(1))) long long b : 62; __attribute__((aligned(1))) long long b : 62;
char c; char c;
}; };
#if defined(__arm__) || defined(__aarch64__) #if defined(__arm__) || defined(__aarch64__) || defined(__x86_64__)
CHECK_SIZE(struct, g11, 24); CHECK_SIZE(struct, g11, 24);
CHECK_ALIGN(struct, g11, 8); CHECK_ALIGN(struct, g11, 8);
CHECK_OFFSET(struct, g11, c, 16); CHECK_OFFSET(struct, g11, c, 16);
...@@ -218,6 +219,10 @@ struct g13 { ...@@ -218,6 +219,10 @@ struct g13 {
CHECK_SIZE(struct, g13, 16); CHECK_SIZE(struct, g13, 16);
CHECK_ALIGN(struct, g13, 8); CHECK_ALIGN(struct, g13, 8);
CHECK_OFFSET(struct, g13, c, 8); CHECK_OFFSET(struct, g13, c, 8);
#elif (__x86_64__)
CHECK_SIZE(struct, g13, 9);
CHECK_ALIGN(struct, g13, 1);
CHECK_OFFSET(struct, g13, c, 8);
#else #else
CHECK_SIZE(struct, g13, 5); CHECK_SIZE(struct, g13, 5);
CHECK_ALIGN(struct, g13, 1); CHECK_ALIGN(struct, g13, 1);
...@@ -233,6 +238,10 @@ struct __attribute__((packed)) g14 { ...@@ -233,6 +238,10 @@ struct __attribute__((packed)) g14 {
CHECK_SIZE(struct, g14, 16); CHECK_SIZE(struct, g14, 16);
CHECK_ALIGN(struct, g14, 8); CHECK_ALIGN(struct, g14, 8);
CHECK_OFFSET(struct, g14, c, 8); CHECK_OFFSET(struct, g14, c, 8);
#elif (__x86_64__)
CHECK_SIZE(struct, g14, 9);
CHECK_ALIGN(struct, g14, 1);
CHECK_OFFSET(struct, g14, c, 8);
#else #else
CHECK_SIZE(struct, g14, 5); CHECK_SIZE(struct, g14, 5);
CHECK_ALIGN(struct, g14, 1); CHECK_ALIGN(struct, g14, 1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment