blob: f1c9a5d73fa635566d8180efb7a46897f2c63343 [file] [log] [blame]
Chris Lattner3cc5e5b2008-06-27 22:48:56 +00001// RUN: clang %s -emit-llvm -o -
Chris Lattnerefdd1572008-01-02 21:54:09 +00002
3// PR1895
4// sizeof function
5int zxcv(void);
6int x=sizeof(zxcv);
7int y=__alignof__(zxcv);
8
Chris Lattner8f925282008-01-03 06:36:51 +00009
10void *test(int *i) {
11 short a = 1;
12 i += a;
13 i + a;
14 a + i;
15}
16
Chris Lattner01e3c9e2008-01-30 07:01:17 +000017_Bool test2b;
18int test2() {if (test2b);}
19
Chris Lattner6860f3c2008-01-31 04:12:50 +000020// PR1921
21int test3() {
22 const unsigned char *bp;
23 bp -= (short)1;
24}
25
Chris Lattnera269ebf2008-02-21 05:45:29 +000026// PR2080 - sizeof void
27int t1 = sizeof(void);
28int t2 = __alignof__(void);
29void test4() {
30 t1 = sizeof(void);
31 t2 = __alignof__(void);
32
33 t1 = sizeof(test4());
34 t2 = __alignof__(test4());
35}
36
Chris Lattner3cc5e5b2008-06-27 22:48:56 +000037// 'const float' promotes to double in varargs.
38int test5(const float x, float float_number) {
39 return __builtin_isless(x, float_number);
40}
41