1*f4a2713aSLionel Sambuc // RUN: %clang -target mipsel-unknown-nacl -### %s -emit-llvm-only -c -o %t.o 2>&1 | FileCheck %s -check-prefix=ECHO 2*f4a2713aSLionel Sambuc // RUN: %clang -target mipsel-unknown-nacl %s -emit-llvm -S -c -o - | FileCheck %s 3*f4a2713aSLionel Sambuc // RUN: %clang -target mipsel-unknown-nacl %s -emit-llvm -S -c -pthread -o - | FileCheck %s -check-prefix=THREADS 4*f4a2713aSLionel Sambuc 5*f4a2713aSLionel Sambuc // ECHO: {{.*}} "-cc1" {{.*}}mipsel-nacl-defines.c 6*f4a2713aSLionel Sambuc 7*f4a2713aSLionel Sambuc // Check platform defines 8*f4a2713aSLionel Sambuc 9*f4a2713aSLionel Sambuc // CHECK: _MIPSELdefined 10*f4a2713aSLionel Sambuc #ifdef _MIPSEL _MIPSELdefined()11*f4a2713aSLionel Sambucvoid _MIPSELdefined() {} 12*f4a2713aSLionel Sambuc #endif 13*f4a2713aSLionel Sambuc 14*f4a2713aSLionel Sambuc // CHECK: _mipsdefined 15*f4a2713aSLionel Sambuc #ifdef _mips _mipsdefined()16*f4a2713aSLionel Sambucvoid _mipsdefined() {} 17*f4a2713aSLionel Sambuc #endif 18*f4a2713aSLionel Sambuc 19*f4a2713aSLionel Sambuc // CHECK: __native_client__defined 20*f4a2713aSLionel Sambuc #ifdef __native_client__ __native_client__defined()21*f4a2713aSLionel Sambucvoid __native_client__defined() {} 22*f4a2713aSLionel Sambuc #endif 23*f4a2713aSLionel Sambuc 24*f4a2713aSLionel Sambuc // CHECK: unixdefined 25*f4a2713aSLionel Sambuc #ifdef unix unixdefined()26*f4a2713aSLionel Sambucvoid unixdefined() {} 27*f4a2713aSLionel Sambuc #endif 28*f4a2713aSLionel Sambuc 29*f4a2713aSLionel Sambuc // CHECK: __ELF__defined 30*f4a2713aSLionel Sambuc #ifdef __ELF__ __ELF__defined()31*f4a2713aSLionel Sambucvoid __ELF__defined() {} 32*f4a2713aSLionel Sambuc #endif 33*f4a2713aSLionel Sambuc 34*f4a2713aSLionel Sambuc // CHECK: _GNU_SOURCEdefined 35*f4a2713aSLionel Sambuc #ifdef _GNU_SOURCE _GNU_SOURCEdefined()36*f4a2713aSLionel Sambucvoid _GNU_SOURCEdefined() {} 37*f4a2713aSLionel Sambuc #endif 38*f4a2713aSLionel Sambuc 39*f4a2713aSLionel Sambuc // THREADS: _REENTRANTdefined 40*f4a2713aSLionel Sambuc // CHECK: _REENTRANTundefined 41*f4a2713aSLionel Sambuc #ifdef _REENTRANT _REENTRANTdefined()42*f4a2713aSLionel Sambucvoid _REENTRANTdefined() {} 43*f4a2713aSLionel Sambuc #else _REENTRANTundefined()44*f4a2713aSLionel Sambucvoid _REENTRANTundefined() {} 45*f4a2713aSLionel Sambuc #endif 46