xref: /minix3/external/bsd/llvm/dist/clang/test/Sema/conversion-64-32.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only -verify -Wshorten-64-to-32 -triple x86_64-apple-darwin %s
2*f4a2713aSLionel Sambuc 
test0(long v)3*f4a2713aSLionel Sambuc int test0(long v) {
4*f4a2713aSLionel Sambuc   return v; // expected-warning {{implicit conversion loses integer precision}}
5*f4a2713aSLionel Sambuc }
6*f4a2713aSLionel Sambuc 
7*f4a2713aSLionel Sambuc 
8*f4a2713aSLionel Sambuc // rdar://9546171
9*f4a2713aSLionel Sambuc typedef int  int4  __attribute__ ((vector_size(16)));
10*f4a2713aSLionel Sambuc typedef long long long2 __attribute__((__vector_size__(16)));
11*f4a2713aSLionel Sambuc 
test1(long2 a)12*f4a2713aSLionel Sambuc int4 test1(long2 a) {
13*f4a2713aSLionel Sambuc   int4  v127 = a;  // no warning.
14*f4a2713aSLionel Sambuc   return v127;
15*f4a2713aSLionel Sambuc }
16*f4a2713aSLionel Sambuc 
test2(long v)17*f4a2713aSLionel Sambuc int test2(long v) {
18*f4a2713aSLionel Sambuc   return v / 2; // expected-warning {{implicit conversion loses integer precision: 'long' to 'int'}}
19*f4a2713aSLionel Sambuc }
20