// RUN: %clang_cc1 -fsyntax-only -verify %s

typedef __typeof((int*) 0 - (int*) 0) intptr_t;

static int f = 10;
static int b = f; // expected-error {{initializer element is not a compile-time constant}}

float r  = (float) (intptr_t) &r; // expected-error {{initializer element is not a compile-time constant}}
intptr_t s = (intptr_t) &s;
_Bool t = &t;


union bar {
  int i;
};

struct foo {
  unsigned ptr;
};

union bar u[1];
struct foo x = {(intptr_t) u}; // no-error
struct foo y = {(char) u}; // expected-error {{initializer element is not a compile-time constant}}

// RUN: %clang_cc1 -triple i386-pc-linux-gnu -fsyntax-only -verify %s

#include <stdint.h>

static int f = 10;
static int b = f; // expected-error {{initializer element is not a compile-time constant}}

float r  = (float) (intptr_t) &r; // expected-error {{initializer element is not a compile-time constant}}
intptr_t s = (intptr_t) &s;
_Bool t = &t;


union bar {
  int i;
};

struct foo {
  unsigned ptr;
};

union bar u[1];
struct foo x = {(intptr_t) u}; // no-error
struct foo y = {(char) u}; // expected-error {{initializer element is not a compile-time constant}}

--- 
+++ 
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -triple i386-pc-linux-gnu -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify %s
 
-#include <stdint.h>
+typedef __typeof((int*) 0 - (int*) 0) intptr_t;
 
 static int f = 10;
 static int b = f; // expected-error {{initializer element is not a compile-time constant}}
Fix test to not force triple, and also to not need stdint.h.

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@96499 91177308-0d34-0410-b5e6-96231b3b80d8
