1ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com// RUN: %clang_cc1 %s -emit-llvm -o - -triple=i686-unknown-nacl | FileCheck %s
2ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com// Check that i686-nacl essentially has -malign-double, which aligns
3ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com// double, long double, and long long to 64-bits.
4ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com
5ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.comint checksize[sizeof(long double) == 8 ? 1 : -1];
6ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.comint checkalign[__alignof(long double) == 8 ? 1 : -1];
7ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com
8ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com// CHECK-LABEL: define void @s1(double %a)
98a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comvoid s1(long double a) {}
108a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
118a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comstruct st_ld {
128a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com  char c;
138a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com  long double ld;
148a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com};
158a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comint checksize2[sizeof(struct st_ld) == 16 ? 1 : -1];
168a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comint checkalign2[__alignof(struct st_ld) == 8 ? 1 : -1];
178a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
188a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comint checksize3[sizeof(double) == 8 ? 1 : -1];
198a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comint checkalign3[__alignof(double) == 8 ? 1 : -1];
208a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
218a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com// CHECK-LABEL: define void @s2(double %a)
228a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comvoid s2(double a) {}
238a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
248a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comstruct st_d {
258a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com  char c;
268a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com  double d;
278a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com};
288a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comint checksize4[sizeof(struct st_d) == 16 ? 1 : -1];
298a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comint checkalign4[__alignof(struct st_d) == 8 ? 1 : -1];
308a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
318a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
328a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comint checksize5[sizeof(long long) == 8 ? 1 : -1];
338a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comint checkalign5[__alignof(long long) == 8 ? 1 : -1];
348a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
358a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com// CHECK-LABEL: define void @s3(i64 %a)
368a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comvoid s3(long long a) {}
378a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
388a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comstruct st_ll {
398a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com  char c;
408a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com  long long ll;
418a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com};
428a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comint checksize6[sizeof(struct st_ll) == 16 ? 1 : -1];
438a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comint checkalign6[__alignof(struct st_ll) == 8 ? 1 : -1];
448a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com