[cfe-commits] r136159 - /cfe/trunk/test/CodeGen/

Eric Christopher echristo at apple.com
Tue Jul 26 15:17:04 PDT 2011


Author: echristo
Date: Tue Jul 26 17:17:02 2011
New Revision: 136159

URL: http://llvm.org/viewvc/llvm-project?rev=136159&view=rev
Log:
Migrate most of the rest of test/FrontendC from llvm and migrate
most of them to FileCheck.

Added:
    cfe/trunk/test/CodeGen/2002-01-23-LoadQISIReloadFailure.c
    cfe/trunk/test/CodeGen/2002-01-24-ComplexSpaceInType.c
    cfe/trunk/test/CodeGen/2002-01-24-HandleCallInsnSEGV.c
    cfe/trunk/test/CodeGen/2002-02-13-ConditionalInCall.c
    cfe/trunk/test/CodeGen/2002-02-13-ReloadProblem.c
    cfe/trunk/test/CodeGen/2002-02-13-TypeVarNameCollision.c
    cfe/trunk/test/CodeGen/2002-02-13-UnnamedLocal.c
    cfe/trunk/test/CodeGen/2002-02-14-EntryNodePreds.c
    cfe/trunk/test/CodeGen/2002-02-16-RenamingTest.c
    cfe/trunk/test/CodeGen/2002-02-17-ArgumentAddress.c
    cfe/trunk/test/CodeGen/2002-02-18-StaticData.c
    cfe/trunk/test/CodeGen/2002-03-12-ArrayInitialization.c
    cfe/trunk/test/CodeGen/2002-03-12-StructInitialize.c
    cfe/trunk/test/CodeGen/2002-03-12-StructInitializer.c
    cfe/trunk/test/CodeGen/2002-03-14-BrokenPHINode.c
    cfe/trunk/test/CodeGen/2002-03-14-BrokenSSA.c
    cfe/trunk/test/CodeGen/2002-03-14-QuotesInStrConst.c
    cfe/trunk/test/CodeGen/2002-04-07-SwitchStmt.c
    cfe/trunk/test/CodeGen/2002-04-08-LocalArray.c
    cfe/trunk/test/CodeGen/2002-04-09-StructRetVal.c
    cfe/trunk/test/CodeGen/2002-04-10-StructParameters.c
    cfe/trunk/test/CodeGen/2002-05-23-StaticValues.c
    cfe/trunk/test/CodeGen/2002-05-23-TypeNameCollision.c
    cfe/trunk/test/CodeGen/2002-07-14-MiscListTests.c
    cfe/trunk/test/CodeGen/2002-07-14-MiscTests.c
    cfe/trunk/test/CodeGen/2002-07-14-MiscTests2.c
    cfe/trunk/test/CodeGen/2002-07-16-HardStringInit.c
    cfe/trunk/test/CodeGen/2002-07-17-StringConstant.c
    cfe/trunk/test/CodeGen/2002-07-30-SubregSetAssertion.c
    cfe/trunk/test/CodeGen/2002-07-30-UnionTest.c
    cfe/trunk/test/CodeGen/2002-07-30-VarArgsCallFailure.c
    cfe/trunk/test/CodeGen/2002-07-31-BadAssert.c
    cfe/trunk/test/CodeGen/2002-07-31-SubregFailure.c
    cfe/trunk/test/CodeGen/2002-08-19-RecursiveLocals.c
    cfe/trunk/test/CodeGen/2002-09-08-PointerShifts.c
    cfe/trunk/test/CodeGen/2002-09-18-UnionProblem.c
    cfe/trunk/test/CodeGen/2002-10-12-TooManyArguments.c
    cfe/trunk/test/CodeGen/2002-12-15-GlobalBoolTest.c
    cfe/trunk/test/CodeGen/2002-12-15-GlobalConstantTest.c
    cfe/trunk/test/CodeGen/2002-12-15-GlobalRedefinition.c
    cfe/trunk/test/CodeGen/2002-12-15-StructParameters.c
    cfe/trunk/test/CodeGen/2003-01-30-UnionInit.c
    cfe/trunk/test/CodeGen/2003-03-03-DeferredType.c
    cfe/trunk/test/CodeGen/2003-06-22-UnionCrash.c
    cfe/trunk/test/CodeGen/2003-06-23-GCC-fold-infinite-recursion.c
    cfe/trunk/test/CodeGen/2003-06-26-CFECrash.c
    cfe/trunk/test/CodeGen/2003-06-29-MultipleFunctionDefinition.c
    cfe/trunk/test/CodeGen/2003-07-22-ArrayAccessTypeSafety.c
    cfe/trunk/test/CodeGen/2003-08-06-BuiltinSetjmpLongjmp.c
    cfe/trunk/test/CodeGen/2003-08-17-DeadCodeShortCircuit.c
    cfe/trunk/test/CodeGen/2003-08-18-StructAsValue.c
    cfe/trunk/test/CodeGen/2003-08-20-BadBitfieldRef.c
    cfe/trunk/test/CodeGen/2003-08-20-PrototypeMismatch.c
    cfe/trunk/test/CodeGen/2003-08-20-vfork-bug.c
    cfe/trunk/test/CodeGen/2003-08-21-BinOp-Type-Mismatch.c
    cfe/trunk/test/CodeGen/2003-08-21-StmtExpr.c
    cfe/trunk/test/CodeGen/2003-08-23-LocalUnionTest.c
    cfe/trunk/test/CodeGen/2003-08-29-BitFieldStruct.c
    cfe/trunk/test/CodeGen/2003-08-29-HugeCharConst.c
    cfe/trunk/test/CodeGen/2003-08-30-AggregateInitializer.c
    cfe/trunk/test/CodeGen/2003-09-30-StructLayout.c
    cfe/trunk/test/CodeGen/2003-10-09-UnionInitializerBug.c
    cfe/trunk/test/CodeGen/2003-10-28-ident.c
    cfe/trunk/test/CodeGen/2003-10-29-AsmRename.c
    cfe/trunk/test/CodeGen/2003-11-01-C99-CompoundLiteral.c
    cfe/trunk/test/CodeGen/2003-11-01-EmptyStructCrash.c
    cfe/trunk/test/CodeGen/2003-11-01-GlobalUnionInit.c
    cfe/trunk/test/CodeGen/2003-11-03-AddrArrayElement.c
    cfe/trunk/test/CodeGen/2003-11-04-EmptyStruct.c
    cfe/trunk/test/CodeGen/2003-11-04-OutOfMemory.c
    cfe/trunk/test/CodeGen/2003-11-08-PointerSubNotGetelementptr.c
    cfe/trunk/test/CodeGen/2003-11-12-VoidString.c
    cfe/trunk/test/CodeGen/2003-11-18-CondExprLValue.c
    cfe/trunk/test/CodeGen/2003-11-19-AddressOfRegister.c
    cfe/trunk/test/CodeGen/2003-11-19-BitFieldArray.c
    cfe/trunk/test/CodeGen/2003-11-20-Bitfields.c
    cfe/trunk/test/CodeGen/2003-11-20-ComplexDivision.c
    cfe/trunk/test/CodeGen/2003-11-20-UnionBitfield.c
    cfe/trunk/test/CodeGen/2003-11-26-PointerShift.c
    cfe/trunk/test/CodeGen/2003-11-27-ConstructorCast.c
    cfe/trunk/test/CodeGen/2003-11-27-UnionCtorInitialization.c
    cfe/trunk/test/CodeGen/2003-12-14-ExternInlineSupport.c
    cfe/trunk/test/CodeGen/2004-01-01-UnknownInitSize.c
    cfe/trunk/test/CodeGen/2004-02-12-LargeAggregateCopy.c
    cfe/trunk/test/CodeGen/2004-02-13-BuiltinFrameReturnAddress.c
    cfe/trunk/test/CodeGen/2004-02-13-Memset.c
    cfe/trunk/test/CodeGen/2004-02-14-ZeroInitializer.c
    cfe/trunk/test/CodeGen/2004-03-07-ComplexDivEquals.c
    cfe/trunk/test/CodeGen/2004-03-07-ExternalConstant.c
    cfe/trunk/test/CodeGen/2004-03-09-LargeArrayInitializers.c
    cfe/trunk/test/CodeGen/2004-03-16-AsmRegisterCrash.c
    cfe/trunk/test/CodeGen/2004-05-07-VarArrays.c
    cfe/trunk/test/CodeGen/2004-05-21-IncompleteEnum.c
    cfe/trunk/test/CodeGen/2004-06-08-OpaqueStructArg.c
    cfe/trunk/test/CodeGen/2004-06-17-UnorderedBuiltins.c
    cfe/trunk/test/CodeGen/2004-06-18-VariableLengthArrayOfStructures.c
    cfe/trunk/test/CodeGen/2004-07-06-FunctionCast.c
    cfe/trunk/test/CodeGen/2004-08-06-LargeStructTest.c
    cfe/trunk/test/CodeGen/2004-11-25-UnnamedBitfieldPadding.c
    cfe/trunk/test/CodeGen/2004-11-27-StaticFunctionRedeclare.c
    cfe/trunk/test/CodeGen/2005-01-02-ConstantInits.c
    cfe/trunk/test/CodeGen/2005-01-02-PointerDifference.c
    cfe/trunk/test/CodeGen/2005-02-27-MarkGlobalConstant.c
    cfe/trunk/test/CodeGen/2005-03-05-OffsetOfHack.c
    cfe/trunk/test/CodeGen/2005-03-06-OffsetOfStructCrash.c
    cfe/trunk/test/CodeGen/2005-03-11-Prefetch.c
    cfe/trunk/test/CodeGen/2005-05-06-CountBuiltins.c
    cfe/trunk/test/CodeGen/2005-05-10-GlobalUnionInit.c
    cfe/trunk/test/CodeGen/2005-07-26-UnionInitCrash.c
    cfe/trunk/test/CodeGen/2005-07-28-IncorrectWeakGlobal.c
    cfe/trunk/test/CodeGen/2005-09-20-ComplexConstants.c
    cfe/trunk/test/CodeGen/2005-09-24-AsmUserPrefix.c
    cfe/trunk/test/CodeGen/2005-09-24-BitFieldCrash.c
    cfe/trunk/test/CodeGen/2005-12-04-AttributeUsed.c
    cfe/trunk/test/CodeGen/2005-12-04-DeclarationLineNumbers.c
    cfe/trunk/test/CodeGen/2006-01-13-StackSave.c
    cfe/trunk/test/CodeGen/2006-01-16-BitCountIntrinsicsUnsigned.c
    cfe/trunk/test/CodeGen/2006-01-23-FileScopeAsm.c
    cfe/trunk/test/CodeGen/2006-03-03-MissingInitializer.c
    cfe/trunk/test/CodeGen/2006-03-16-VectorCtor.c
    cfe/trunk/test/CodeGen/2006-03-17-KnRMismatch.c
    cfe/trunk/test/CodeGen/2006-05-19-SingleEltReturn.c
    cfe/trunk/test/CodeGen/2006-07-31-PR854.c
    cfe/trunk/test/CodeGen/2006-09-11-BitfieldRefCrash.c
    cfe/trunk/test/CodeGen/2006-09-18-fwrite-cast-crash.c
    cfe/trunk/test/CodeGen/2006-09-21-IncompleteElementType.c
    cfe/trunk/test/CodeGen/2006-09-25-DebugFilename.c
    cfe/trunk/test/CodeGen/2006-09-25-DebugFilename.h
    cfe/trunk/test/CodeGen/2006-09-28-SimpleAsm.c
    cfe/trunk/test/CodeGen/2006-10-30-ArrayCrash.c
    cfe/trunk/test/CodeGen/2006-12-14-ordered_expr.c
    cfe/trunk/test/CodeGen/2007-01-06-KNR-Proto.c
    cfe/trunk/test/CodeGen/2007-01-20-VectorICE.c
    cfe/trunk/test/CodeGen/2007-01-24-InlineAsmCModifier.c
    cfe/trunk/test/CodeGen/2007-02-04-AddrLValue-2.c
    cfe/trunk/test/CodeGen/2007-02-04-AddrLValue.c
    cfe/trunk/test/CodeGen/2007-02-04-EmptyStruct.c
    cfe/trunk/test/CodeGen/2007-02-16-VoidPtrDiff.c
    cfe/trunk/test/CodeGen/2007-02-25-C-DotDotDot.c
    cfe/trunk/test/CodeGen/2007-03-01-VarSizeArrayIdx.c
    cfe/trunk/test/CodeGen/2007-03-26-BitfieldAfterZeroWidth.c
    cfe/trunk/test/CodeGen/2007-03-26-ZeroWidthBitfield.c
    cfe/trunk/test/CodeGen/2007-03-27-VarLengthArray.c
    cfe/trunk/test/CodeGen/2007-04-05-PackedBitFields-2.c
    cfe/trunk/test/CodeGen/2007-04-05-PackedBitFields.c
    cfe/trunk/test/CodeGen/2007-04-05-PackedStruct.c
    cfe/trunk/test/CodeGen/2007-04-05-PadBeforeZeroLengthField.c
    cfe/trunk/test/CodeGen/2007-04-11-InlineAsmStruct.c
    cfe/trunk/test/CodeGen/2007-04-11-InlineAsmUnion.c
    cfe/trunk/test/CodeGen/2007-04-13-InlineAsmStruct2.c
    cfe/trunk/test/CodeGen/2007-04-13-InlineAsmUnion2.c
    cfe/trunk/test/CodeGen/2007-04-14-FNoBuiltin.c
    cfe/trunk/test/CodeGen/2007-04-17-ZeroSizeBitFields.c
    cfe/trunk/test/CodeGen/2007-04-24-bit-not-expr.c
    cfe/trunk/test/CodeGen/2007-05-07-PaddingElements.c
    cfe/trunk/test/CodeGen/2007-05-08-PCH.c
    cfe/trunk/test/CodeGen/2007-05-15-PaddingElement.c
    cfe/trunk/test/CodeGen/2007-05-16-EmptyStruct.c
    cfe/trunk/test/CodeGen/2007-05-29-UnionCopy.c
    cfe/trunk/test/CodeGen/2007-06-15-AnnotateAttribute.c
    cfe/trunk/test/CodeGen/2007-06-18-SextAttrAggregate.c
    cfe/trunk/test/CodeGen/2007-07-29-RestrictPtrArg.c
    cfe/trunk/test/CodeGen/2007-08-01-LoadStoreAlign.c
    cfe/trunk/test/CodeGen/2007-08-21-ComplexCst.c
    cfe/trunk/test/CodeGen/2007-08-22-CTTZ.c
    cfe/trunk/test/CodeGen/2007-09-05-ConstCtor.c
    cfe/trunk/test/CodeGen/2007-09-14-NegatePointer.c
    cfe/trunk/test/CodeGen/2007-09-26-Alignment.c
    cfe/trunk/test/CodeGen/2007-09-28-PackedUnionMember.c
    cfe/trunk/test/CodeGen/2007-10-02-VolatileArray.c
    cfe/trunk/test/CodeGen/2007-10-15-VoidPtr.c
    cfe/trunk/test/CodeGen/2007-10-30-Volatile.c
    cfe/trunk/test/CodeGen/2007-11-07-AlignedMemcpy.c
    cfe/trunk/test/CodeGen/2007-11-07-CopyAggregateAlign.c
    cfe/trunk/test/CodeGen/2007-11-07-ZeroAggregateAlign.c
    cfe/trunk/test/CodeGen/2007-11-28-GlobalInitializer.c
    cfe/trunk/test/CodeGen/2007-12-16-AsmNoUnwind.c
    cfe/trunk/test/CodeGen/2008-01-07-UnusualIntSize.c
    cfe/trunk/test/CodeGen/2008-01-11-ChainConsistency.c
    cfe/trunk/test/CodeGen/2008-01-21-PackedBitFields.c
    cfe/trunk/test/CodeGen/2008-01-21-PackedStructField.c
    cfe/trunk/test/CodeGen/2008-01-24-StructAlignAndBitFields.c
    cfe/trunk/test/CodeGen/2008-01-25-ByValReadNone.c
    cfe/trunk/test/CodeGen/2008-01-25-ZeroSizedAggregate.c
    cfe/trunk/test/CodeGen/2008-01-28-PragmaMark.c
    cfe/trunk/test/CodeGen/2008-01-28-UnionSize.c
    cfe/trunk/test/CodeGen/2008-03-03-CtorAttrType.c
    cfe/trunk/test/CodeGen/2008-03-05-syncPtr.c
    cfe/trunk/test/CodeGen/2008-03-24-BitField-And-Alloca.c
    cfe/trunk/test/CodeGen/2008-03-26-PackedBitFields.c
    cfe/trunk/test/CodeGen/2008-04-08-NoExceptions.c
    cfe/trunk/test/CodeGen/2008-05-06-CFECrash.c
    cfe/trunk/test/CodeGen/2008-05-12-TempUsedBeforeDef.c
    cfe/trunk/test/CodeGen/2008-05-19-AlwaysInline.c
    cfe/trunk/test/CodeGen/2008-08-07-AlignPadding1.c
    cfe/trunk/test/CodeGen/2008-08-07-AlignPadding2.c
    cfe/trunk/test/CodeGen/2008-08-07-GEPIntToPtr.c
    cfe/trunk/test/CodeGen/2008-09-03-WeakAlias.c
    cfe/trunk/test/CodeGen/2008-10-13-FrontendCrash.c
    cfe/trunk/test/CodeGen/2008-10-30-ZeroPlacement.c
    cfe/trunk/test/CodeGen/2008-11-02-WeakAlias.c
    cfe/trunk/test/CodeGen/2008-11-08-InstCombineSelect.c
    cfe/trunk/test/CodeGen/2009-01-05-BlockInlining.c
    cfe/trunk/test/CodeGen/2009-01-21-InvalidIterator.c
    cfe/trunk/test/CodeGen/2009-02-13-zerosize-union-field-ppc.c
    cfe/trunk/test/CodeGen/2009-02-13-zerosize-union-field.c
    cfe/trunk/test/CodeGen/2009-03-01-MallocNoAlias.c
    cfe/trunk/test/CodeGen/2009-03-08-ZeroEltStructCrash.c
    cfe/trunk/test/CodeGen/2009-03-13-dbg.c
    cfe/trunk/test/CodeGen/2009-04-28-UnionArrayCrash.c
    cfe/trunk/test/CodeGen/2009-05-04-EnumInreg.c
    cfe/trunk/test/CodeGen/2009-06-14-HighlyAligned.c
    cfe/trunk/test/CodeGen/2009-06-18-StaticInitTailPadPack.c
    cfe/trunk/test/CodeGen/2009-07-14-VoidPtr.c
    cfe/trunk/test/CodeGen/2009-07-22-StructLayout.c
    cfe/trunk/test/CodeGen/2009-12-07-BitFieldAlignment.c
    cfe/trunk/test/CodeGen/2010-01-13-MemBarrier.c
    cfe/trunk/test/CodeGen/2010-01-14-FnType-DebugInfo.c
    cfe/trunk/test/CodeGen/2010-01-18-Inlined-Debug.c
    cfe/trunk/test/CodeGen/2010-02-10-PointerName.c
    cfe/trunk/test/CodeGen/2010-02-15-DbgStaticVar.c
    cfe/trunk/test/CodeGen/2010-03-10-arm-asmreg.c
    cfe/trunk/test/CodeGen/2010-03-5-LexicalScope.c
    cfe/trunk/test/CodeGen/2010-05-26-AsmSideEffect.c
    cfe/trunk/test/CodeGen/2010-06-11-SaveExpr.c
    cfe/trunk/test/CodeGen/2010-06-17-asmcrash.c
    cfe/trunk/test/CodeGen/2010-07-08-DeclDebugLineNo.c
    cfe/trunk/test/CodeGen/2010-07-14-overconservative-align.c
    cfe/trunk/test/CodeGen/2010-08-12-asm-aggr-arg.c
    cfe/trunk/test/CodeGen/2010-12-01-CommonGlobal.c
    cfe/trunk/test/CodeGen/2011-02-21-DATA-common.c
    cfe/trunk/test/CodeGen/2011-03-02-UnionInitializer.c
    cfe/trunk/test/CodeGen/2011-03-08-ZeroFieldUnionInitializer.c
    cfe/trunk/test/CodeGen/Atomics.c
    cfe/trunk/test/CodeGen/BasicInstrs.c
    cfe/trunk/test/CodeGen/always-inline.c
    cfe/trunk/test/CodeGen/arrayderef.c
    cfe/trunk/test/CodeGen/asm-reg-var-local.c
    cfe/trunk/test/CodeGen/attribute_constructor.c
    cfe/trunk/test/CodeGen/block-copy.c
    cfe/trunk/test/CodeGen/exact-div-expr.c
    cfe/trunk/test/CodeGen/extern-weak.c
    cfe/trunk/test/CodeGen/func-aligned.c
    cfe/trunk/test/CodeGen/funccall.c
    cfe/trunk/test/CodeGen/hidden-visibility.c
    cfe/trunk/test/CodeGen/implicit-arg.c
    cfe/trunk/test/CodeGen/libcalls-d.c
    cfe/trunk/test/CodeGen/libcalls-ld.c
    cfe/trunk/test/CodeGen/misaligned-param.c
    cfe/trunk/test/CodeGen/pr2394.c
    cfe/trunk/test/CodeGen/pr3518.c
    cfe/trunk/test/CodeGen/pr4349.c
    cfe/trunk/test/CodeGen/pr5406.c
    cfe/trunk/test/CodeGen/redef-ext-inline.c
    cfe/trunk/test/CodeGen/sret.c
    cfe/trunk/test/CodeGen/struct-matching-constraint.c
    cfe/trunk/test/CodeGen/unaligned-memcpy.c
    cfe/trunk/test/CodeGen/union-align.c
    cfe/trunk/test/CodeGen/vla-2.c
    cfe/trunk/test/CodeGen/vla-3.c
    cfe/trunk/test/CodeGen/weak_constant.c

Added: cfe/trunk/test/CodeGen/2002-01-23-LoadQISIReloadFailure.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-01-23-LoadQISIReloadFailure.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-01-23-LoadQISIReloadFailure.c (added)
+++ cfe/trunk/test/CodeGen/2002-01-23-LoadQISIReloadFailure.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+/* Regression test.  Just compile .c -> .ll to test */
+int foo(void) {
+  unsigned char *pp;
+  unsigned w_cnt;
+
+  w_cnt += *pp;
+
+  return w_cnt;
+}

Added: cfe/trunk/test/CodeGen/2002-01-24-ComplexSpaceInType.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-01-24-ComplexSpaceInType.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-01-24-ComplexSpaceInType.c (added)
+++ cfe/trunk/test/CodeGen/2002-01-24-ComplexSpaceInType.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+// This caused generation of the following type name:
+//   %Array = uninitialized global [10 x %complex int]
+//
+// which caused problems because of the space int the complex int type
+//
+
+struct { int X, Y; } Array[10];
+
+void foo() {}

Added: cfe/trunk/test/CodeGen/2002-01-24-HandleCallInsnSEGV.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-01-24-HandleCallInsnSEGV.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-01-24-HandleCallInsnSEGV.c (added)
+++ cfe/trunk/test/CodeGen/2002-01-24-HandleCallInsnSEGV.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+void *dlclose(void*);
+
+void ap_os_dso_unload(void *handle)
+{
+    dlclose(handle);
+    return;     /* This return triggers the bug: Weird */
+}

Added: cfe/trunk/test/CodeGen/2002-02-13-ConditionalInCall.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-02-13-ConditionalInCall.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-02-13-ConditionalInCall.c (added)
+++ cfe/trunk/test/CodeGen/2002-02-13-ConditionalInCall.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+/* Test problem where bad code was generated with a ?: statement was 
+   in a function call argument */
+
+void foo(int, double, float);
+
+void bar(int x) {
+  foo(x, x ? 1.0 : 12.5, 1.0f);
+}
+

Added: cfe/trunk/test/CodeGen/2002-02-13-ReloadProblem.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-02-13-ReloadProblem.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-02-13-ReloadProblem.c (added)
+++ cfe/trunk/test/CodeGen/2002-02-13-ReloadProblem.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+/* This triggered a problem in reload, fixed by disabling most of the 
+ * steps of compilation in GCC.  Before this change, the code went through
+ * the entire backend of GCC, even though it was unnecessary for LLVM output
+ * now it is skipped entirely, and since reload doesn't run, it can't cause
+ * a problem.
+ */
+
+extern int tolower(int);
+
+const char *rangematch(const char *pattern, int test, int c) {
+
+  if ((c <= test) | (tolower(c) <= tolower((unsigned char)test)))
+    return 0;
+
+  return pattern;
+}

Added: cfe/trunk/test/CodeGen/2002-02-13-TypeVarNameCollision.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-02-13-TypeVarNameCollision.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-02-13-TypeVarNameCollision.c (added)
+++ cfe/trunk/test/CodeGen/2002-02-13-TypeVarNameCollision.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+/* This testcase causes a symbol table collision.  Type names and variable
+ * names should be in distinct namespaces
+ */
+
+typedef struct foo {
+  int X, Y;
+} FOO;
+
+static FOO foo[100];
+
+int test() {
+  return foo[4].Y;
+}
+

Added: cfe/trunk/test/CodeGen/2002-02-13-UnnamedLocal.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-02-13-UnnamedLocal.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-02-13-UnnamedLocal.c (added)
+++ cfe/trunk/test/CodeGen/2002-02-13-UnnamedLocal.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,21 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+/* Testcase for a problem where GCC allocated xqic to a register,
+ * and did not have a VAR_DECL that explained the stack slot to LLVM.
+ * Now the LLVM code synthesizes a stack slot if one is presented that
+ * has not been previously recognized.  This is where alloca's named 
+ * 'local' come from now. 
+ */
+
+typedef struct {
+  short x;
+} foostruct;
+
+int foo(foostruct ic);
+
+void test() {
+  foostruct xqic;
+  foo(xqic);
+}
+
+

Added: cfe/trunk/test/CodeGen/2002-02-14-EntryNodePreds.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-02-14-EntryNodePreds.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-02-14-EntryNodePreds.c (added)
+++ cfe/trunk/test/CodeGen/2002-02-14-EntryNodePreds.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,37 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+/* GCC Used to generate code that contained a branch to the entry node of 
+ * the do_merge function.  This is illegal LLVM code.  To fix this, GCC now
+ * inserts an entry node regardless of whether or not it has to insert allocas.
+ */
+
+struct edge_rec
+{
+  struct VERTEX *v;
+  struct edge_rec *next;
+  int wasseen;
+  int more_data;
+};
+
+typedef struct edge_rec *QUAD_EDGE;
+
+typedef struct {
+  QUAD_EDGE left, right;
+} EDGE_PAIR;
+
+struct EDGE_STACK {
+    int ptr;
+    QUAD_EDGE *elts;
+    int stack_size;
+};
+
+int do_merge(QUAD_EDGE ldo, QUAD_EDGE rdo) {
+  int lvalid;
+  QUAD_EDGE basel,rcand;
+  while (1) {
+    if (!lvalid) {
+      return (int)basel->next;
+    }
+  }
+}
+

Added: cfe/trunk/test/CodeGen/2002-02-16-RenamingTest.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-02-16-RenamingTest.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-02-16-RenamingTest.c (added)
+++ cfe/trunk/test/CodeGen/2002-02-16-RenamingTest.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+/* test that locals are renamed with . notation */
+
+void abc(void *);
+
+void Test5(double X) {
+  abc(&X);
+  {
+    int X;
+    abc(&X);
+    {
+      float X;
+      abc(&X);
+    }
+  }
+}
+

Added: cfe/trunk/test/CodeGen/2002-02-17-ArgumentAddress.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-02-17-ArgumentAddress.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-02-17-ArgumentAddress.c (added)
+++ cfe/trunk/test/CodeGen/2002-02-17-ArgumentAddress.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,39 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+int test(int X) {
+  return X;
+}
+
+void abc(int *X);
+int def(int Y, int Z) {
+  abc(&Z);
+  return Y;
+}
+
+struct Test { short X, x; int Y, Z; };
+
+int Testing(struct Test *A) {
+  return A->X+A->Y;
+}
+
+int Test2(int X, struct Test A, int Y) {
+  return X+Y+A.X+A.Y;
+}
+int Test3(struct Test A, struct Test B) {
+  return A.X+A.Y+B.Y+B.Z;
+}
+
+struct Test Test4(struct Test A) {
+  return A;
+}
+
+int Test6() {
+  int B[200];
+  return B[4];
+}
+
+struct STest2 { int X; short Y[4]; double Z; };
+
+struct STest2 Test7(struct STest2 X) {
+  return X;
+}

Added: cfe/trunk/test/CodeGen/2002-02-18-StaticData.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-02-18-StaticData.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-02-18-StaticData.c (added)
+++ cfe/trunk/test/CodeGen/2002-02-18-StaticData.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+
+double FOO = 17;
+double BAR = 12.0;
+float XX = 12.0f;
+
+static char *procnames[] = {
+  "EXIT"
+};
+
+void *Data[] = { &FOO, &BAR, &XX };
+

Added: cfe/trunk/test/CodeGen/2002-03-12-ArrayInitialization.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-03-12-ArrayInitialization.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-03-12-ArrayInitialization.c (added)
+++ cfe/trunk/test/CodeGen/2002-03-12-ArrayInitialization.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+/* GCC would generate bad code if not enough initializers are 
+   specified for an array.
+ */
+
+int a[10] = { 0, 2};
+
+char str[10] = "x";
+
+void *Arr[5] = { 0, 0 };
+
+float F[12] = { 1.23f, 34.7f };
+
+struct Test { int X; double Y; };
+
+struct Test Array[10] = { { 2, 12.0 }, { 3, 24.0 } };
+
+int B[4][4] = { { 1, 2, 3, 4}, { 5, 6, 7 }, { 8, 9 } };

Added: cfe/trunk/test/CodeGen/2002-03-12-StructInitialize.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-03-12-StructInitialize.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-03-12-StructInitialize.c (added)
+++ cfe/trunk/test/CodeGen/2002-03-12-StructInitialize.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+
+typedef struct Connection_Type {
+   long    to;
+   char    type[10];
+   long    length;
+} Connection;
+
+Connection link[3]
+= { {1, "link1", 10},
+    {2, "link2", 20},
+    {3, "link3", 30} };
+

Added: cfe/trunk/test/CodeGen/2002-03-12-StructInitializer.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-03-12-StructInitializer.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-03-12-StructInitializer.c (added)
+++ cfe/trunk/test/CodeGen/2002-03-12-StructInitializer.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+/* GCC was not emitting string constants of the correct length when
+ * embedded into a structure field like this.  It thought the strlength
+ * was -1.
+ */
+
+typedef struct Connection_Type {
+   long    to;
+   char    type[10];
+   long    length;
+} Connection;
+
+Connection link[3]
+= { {1, "link1", 10},
+    {2, "link2", 20},
+    {3, "link3", 30} };
+

Added: cfe/trunk/test/CodeGen/2002-03-14-BrokenPHINode.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-03-14-BrokenPHINode.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-03-14-BrokenPHINode.c (added)
+++ cfe/trunk/test/CodeGen/2002-03-14-BrokenPHINode.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+/* GCC was generating PHI nodes with an arity < #pred of the basic block the
+ * PHI node lived in.  This was breaking LLVM because the number of entries
+ * in a PHI node must equal the number of predecessors for a basic block.
+ */
+
+int trys(char *s, int x)
+{
+  int asa;
+  double Val;
+  int LLS;
+  if (x) {
+    asa = LLS + asa;
+  } else {
+  }
+  return asa+(int)Val;
+}
+

Added: cfe/trunk/test/CodeGen/2002-03-14-BrokenSSA.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-03-14-BrokenSSA.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-03-14-BrokenSSA.c (added)
+++ cfe/trunk/test/CodeGen/2002-03-14-BrokenSSA.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+/* This code used to break GCC's SSA computation code.  It would create
+   uses of B & C that are not dominated by their definitions.  See:
+   http://gcc.gnu.org/ml/gcc/2002-03/msg00697.html
+ */
+int bar();
+int foo()
+{
+  int a,b,c;
+
+  a = b + c;
+  b = bar();
+  c = bar();
+  return a + b + c;
+}
+

Added: cfe/trunk/test/CodeGen/2002-03-14-QuotesInStrConst.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-03-14-QuotesInStrConst.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-03-14-QuotesInStrConst.c (added)
+++ cfe/trunk/test/CodeGen/2002-03-14-QuotesInStrConst.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+/* GCC was not escaping quotes in string constants correctly, so this would
+ * get emitted:
+ *  %.LC1 = internal global [32 x sbyte] c"*** Word "%s" on line %d is not\00"
+ */
+
+const char *Foo() {
+  return "*** Word \"%s\" on line %d is not";
+}

Added: cfe/trunk/test/CodeGen/2002-04-07-SwitchStmt.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-04-07-SwitchStmt.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-04-07-SwitchStmt.c (added)
+++ cfe/trunk/test/CodeGen/2002-04-07-SwitchStmt.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+int printf(const char *, ...);
+int foo();
+
+int main() {
+  while (foo()) {
+     switch (foo()) {
+     case 0:
+     case 1:
+     case 2:
+     case 3:
+       printf("3");
+     case 4: printf("4");
+     case 5:
+     case 6:
+     default:
+       break;
+     }
+   }
+   return 0;
+}

Added: cfe/trunk/test/CodeGen/2002-04-08-LocalArray.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-04-08-LocalArray.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-04-08-LocalArray.c (added)
+++ cfe/trunk/test/CodeGen/2002-04-08-LocalArray.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+/* GCC is not outputting the static array to the LLVM backend, so bad things
+ * happen.  Note that if this is defined static, everything seems fine.
+ */
+double test(unsigned X) {
+  double student_t[30]={0.0 , 12.706 , 4.303 , 3.182 , 2.776 , 2.571 ,
+                               2.447 , 2.365 , 2.306 , 2.262 , 2.228 ,
+                               2.201 , 2.179 , 2.160 , 2.145 , 2.131 ,
+                               2.120 , 2.110 , 2.101 , 2.093 , 2.086 ,
+                               2.080 , 2.074 , 2.069 , 2.064 , 2.060 ,
+                               2.056 , 2.052 , 2.048 , 2.045 };
+  return student_t[X];
+}

Added: cfe/trunk/test/CodeGen/2002-04-09-StructRetVal.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-04-09-StructRetVal.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-04-09-StructRetVal.c (added)
+++ cfe/trunk/test/CodeGen/2002-04-09-StructRetVal.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+struct S {
+  int i;
+  short s1, s2;
+};
+
+struct S func_returning_struct(void);
+
+void loop(void) {
+  func_returning_struct();
+}

Added: cfe/trunk/test/CodeGen/2002-04-10-StructParameters.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-04-10-StructParameters.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-04-10-StructParameters.c (added)
+++ cfe/trunk/test/CodeGen/2002-04-10-StructParameters.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+
+typedef struct {
+  char p;
+  short q;
+  char r;
+  int X;
+  short Y, Z;
+  int Q;
+} foo;
+
+int test(foo X, float);
+int testE(char,short,char,int,int,float);
+void test3(foo *X) {
+  X->q = 1;
+}
+
+void test2(foo Y) {
+  testE(Y.p, Y.q, Y.r, Y.X, Y.Y, 0.1f);
+  test(Y, 0.1f);
+  test2(Y);
+  test3(&Y);
+}
+

Added: cfe/trunk/test/CodeGen/2002-05-23-StaticValues.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-05-23-StaticValues.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-05-23-StaticValues.c (added)
+++ cfe/trunk/test/CodeGen/2002-05-23-StaticValues.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+/* Make sure the frontend is correctly marking static stuff as internal! */
+
+int X;
+static int Y = 12;
+
+static void foo(int Z) {
+  Y = Z;
+}
+
+void *test() {
+  foo(12);
+  return &Y;
+}

Added: cfe/trunk/test/CodeGen/2002-05-23-TypeNameCollision.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-05-23-TypeNameCollision.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-05-23-TypeNameCollision.c (added)
+++ cfe/trunk/test/CodeGen/2002-05-23-TypeNameCollision.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+/* Testcase for when struct tag conflicts with typedef name... grr */
+
+typedef struct foo {
+  struct foo *X;
+  int Y;
+} * foo;
+
+foo F1;
+struct foo *F2;
+
+enum bar { test1, test2 };
+
+typedef float bar;
+
+enum bar B1;
+bar B2;
+

Added: cfe/trunk/test/CodeGen/2002-07-14-MiscListTests.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-07-14-MiscListTests.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-07-14-MiscListTests.c (added)
+++ cfe/trunk/test/CodeGen/2002-07-14-MiscListTests.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,71 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+// Test list stuff
+
+void *malloc(unsigned);
+
+// Test opaque structure support.  the list type is defined later
+struct list;
+
+struct list *PassThroughList(struct list *L) {
+  return L;
+}
+
+
+// Recursive data structure tests...
+
+typedef struct list {
+  int Data;
+  struct list *Next;
+} list;
+
+list *Data;
+
+void foo() {
+  static int Foo = 0;            // Test static local variable
+  Foo += 1;                      // Increment static variable
+
+  Data = (list*)malloc(12);      // This is not a proper list allocation
+}
+
+extern list ListNode1;
+list ListNode3 = { 4, 0          };
+list ListNode2 = { 3, &ListNode3 };
+list ListNode0 = { 1, &ListNode1 };
+list ListNode1 = { 2, &ListNode2 };
+
+
+list ListArray[10];
+
+// Iterative insert fn
+void InsertIntoListTail(list **L, int Data) {
+  while (*L)
+    L = &(*L)->Next;
+  *L = (list*)malloc(sizeof(list));
+  (*L)->Data = Data;
+  (*L)->Next = 0;
+}
+
+// Recursive list search fn
+list *FindData(list *L, int Data) {
+  if (L == 0) return 0;
+  if (L->Data == Data) return L;
+  return FindData(L->Next, Data);
+}
+
+void foundIt(void);
+
+// Driver fn...
+void DoListStuff() {
+  list *MyList = 0;
+  InsertIntoListTail(&MyList, 100);
+  InsertIntoListTail(&MyList, 12);
+  InsertIntoListTail(&MyList, 42);
+  InsertIntoListTail(&MyList, 1123);
+  InsertIntoListTail(&MyList, 1213);
+
+  if (FindData(MyList, 75)) foundIt();
+  if (FindData(MyList, 42)) foundIt();
+  if (FindData(MyList, 700)) foundIt();
+}
+

Added: cfe/trunk/test/CodeGen/2002-07-14-MiscTests.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-07-14-MiscTests.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-07-14-MiscTests.c (added)
+++ cfe/trunk/test/CodeGen/2002-07-14-MiscTests.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,57 @@
+// RUN: %clang_cc1 -w -emit-llvm %s  -o /dev/null
+
+/* These are random tests that I used when working on the GCC frontend 
+   originally. */
+
+// test floating point comparison!
+int floatcomptest(double *X, double *Y, float *x, float *y) {
+  return *X < *Y || *x < *y;
+}
+
+extern void *malloc(unsigned);
+
+// Exposed a bug
+void *memset_impl(void *dstpp, int c, unsigned len) {
+  long long int dstp = (long long int) dstpp;
+
+  while (dstp % 4 != 0)
+    {
+      ((unsigned char *) dstp)[0] = c;
+      dstp += 1;
+      len -= 1;
+    }
+  return dstpp;
+}
+
+// TEST problem with signed/unsigned versions of the same constants being shared
+// incorrectly!
+//
+static char *temp;
+static int remaining;
+static char *localmalloc(int size) {
+  char *blah;
+  
+  if (size>remaining) 
+    {
+      temp = (char *) malloc(32768);
+      remaining = 32768;
+      return temp;
+    }
+  return 0;
+}
+
+typedef struct { double X; double Y; int Z; } PBVTest;
+
+PBVTest testRetStruct(float X, double Y, int Z) {
+  PBVTest T = { X, Y, Z };
+  return T;
+}
+PBVTest testRetStruct2(void);  // external func no inlining
+
+
+double CallRetStruct(float X, double Y, int Z) {
+  PBVTest T = testRetStruct2();
+  return T.X+X+Y+Z;
+}
+
+

Added: cfe/trunk/test/CodeGen/2002-07-14-MiscTests2.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-07-14-MiscTests2.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-07-14-MiscTests2.c (added)
+++ cfe/trunk/test/CodeGen/2002-07-14-MiscTests2.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+
+// Test ?: in function calls
+extern fp(int, char*);
+char *Ext;
+void
+__bb_exit_func (void)
+{
+  fp (12, Ext ? Ext : "<none>");
+}
+
+

Added: cfe/trunk/test/CodeGen/2002-07-16-HardStringInit.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-07-16-HardStringInit.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-07-16-HardStringInit.c (added)
+++ cfe/trunk/test/CodeGen/2002-07-16-HardStringInit.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+  char      auto_kibitz_list[100][20] = {
+                                      {"diepx"},
+                                      {"ferret"},
+                                      {"knightc"},
+                                      {"knightcap"}};
+

Added: cfe/trunk/test/CodeGen/2002-07-17-StringConstant.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-07-17-StringConstant.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-07-17-StringConstant.c (added)
+++ cfe/trunk/test/CodeGen/2002-07-17-StringConstant.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,4 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+
+char * foo() { return "\\begin{"; }

Added: cfe/trunk/test/CodeGen/2002-07-30-SubregSetAssertion.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-07-30-SubregSetAssertion.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-07-30-SubregSetAssertion.c (added)
+++ cfe/trunk/test/CodeGen/2002-07-30-SubregSetAssertion.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+
+union X {
+  void *B;
+};
+
+union X foo() {
+  union X A;
+  A.B = (void*)123;
+  return A;
+}

Added: cfe/trunk/test/CodeGen/2002-07-30-UnionTest.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-07-30-UnionTest.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-07-30-UnionTest.c (added)
+++ cfe/trunk/test/CodeGen/2002-07-30-UnionTest.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+union X;
+struct Empty {};
+union F {};
+union Q { union Q *X; };
+union X {
+  char C;
+  int A, Z;
+  long long B;
+  void *b1;
+  struct { int A; long long Z; } Q;
+};
+
+union X foo(union X A) {
+  A.C = 123;
+  A.A = 39249;
+  //A.B = (void*)123040123321;
+  A.B = 12301230123123LL;
+  A.Z = 1;
+  return A;
+}

Added: cfe/trunk/test/CodeGen/2002-07-30-VarArgsCallFailure.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-07-30-VarArgsCallFailure.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-07-30-VarArgsCallFailure.c (added)
+++ cfe/trunk/test/CodeGen/2002-07-30-VarArgsCallFailure.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+int tcount;
+void test(char *, const char*, int);
+void foo() {
+  char Buf[10];
+  test(Buf, "n%%%d", tcount++);
+}

Added: cfe/trunk/test/CodeGen/2002-07-31-BadAssert.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-07-31-BadAssert.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-07-31-BadAssert.c (added)
+++ cfe/trunk/test/CodeGen/2002-07-31-BadAssert.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+typedef struct
+{
+        unsigned char type;        /* Indicates, NORMAL, SUBNORMAL, etc. */
+} InternalFPF;
+
+
+static void SetInternalFPFZero(InternalFPF *dest) {
+  dest->type=0;
+}
+
+void denormalize(InternalFPF *ptr) {
+   SetInternalFPFZero(ptr);
+}
+

Added: cfe/trunk/test/CodeGen/2002-07-31-SubregFailure.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-07-31-SubregFailure.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-07-31-SubregFailure.c (added)
+++ cfe/trunk/test/CodeGen/2002-07-31-SubregFailure.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+
+typedef union {
+   long (*ap)[4];
+} ptrs;
+
+void DoAssignIteration() {
+  ptrs abase;
+  abase.ap+=27;
+  Assignment(*abase.ap);
+}
+
+

Added: cfe/trunk/test/CodeGen/2002-08-19-RecursiveLocals.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-08-19-RecursiveLocals.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-08-19-RecursiveLocals.c (added)
+++ cfe/trunk/test/CodeGen/2002-08-19-RecursiveLocals.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+/* This testcase doesn't actually test a bug, it's just the result of me 
+ * figuring out the syntax for forward declaring a static variable. */
+struct list {
+  int x;
+  struct list *Next;
+};
+
+static struct list B;  /* Forward declare static */
+static struct list A = { 7, &B };
+static struct list B = { 8, &A };
+
+extern struct list D;  /* forward declare normal var */
+
+struct list C = { 7, &D };
+struct list D = { 8, &C };
+

Added: cfe/trunk/test/CodeGen/2002-09-08-PointerShifts.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-09-08-PointerShifts.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-09-08-PointerShifts.c (added)
+++ cfe/trunk/test/CodeGen/2002-09-08-PointerShifts.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+
+int foo(int *A, unsigned X) {
+  return A[X];
+}

Added: cfe/trunk/test/CodeGen/2002-09-18-UnionProblem.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-09-18-UnionProblem.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-09-18-UnionProblem.c (added)
+++ cfe/trunk/test/CodeGen/2002-09-18-UnionProblem.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,26 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+
+struct DWstruct {
+  char high, low;
+};
+
+typedef union {
+  struct DWstruct s;
+  short ll;
+} DWunion;
+
+short __udivmodhi4 (char n1, char bm) {
+  DWunion rr;
+
+  if (bm == 0)
+    {
+      rr.s.high = n1;
+    }
+  else
+    {
+      rr.s.high = bm;
+    }
+
+  return rr.ll;
+}

Added: cfe/trunk/test/CodeGen/2002-10-12-TooManyArguments.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-10-12-TooManyArguments.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-10-12-TooManyArguments.c (added)
+++ cfe/trunk/test/CodeGen/2002-10-12-TooManyArguments.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+
+void foo() {}
+
+void bar() {
+  foo(1, 2, 3);  /* Too many arguments passed */
+}

Added: cfe/trunk/test/CodeGen/2002-12-15-GlobalBoolTest.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-12-15-GlobalBoolTest.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-12-15-GlobalBoolTest.c (added)
+++ cfe/trunk/test/CodeGen/2002-12-15-GlobalBoolTest.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+
+_Bool X = 0;
+

Added: cfe/trunk/test/CodeGen/2002-12-15-GlobalConstantTest.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-12-15-GlobalConstantTest.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-12-15-GlobalConstantTest.c (added)
+++ cfe/trunk/test/CodeGen/2002-12-15-GlobalConstantTest.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+
+const char *W = "foo";
+const int X = 7;
+int Y = 8;
+const char * const Z = "bar";
+

Added: cfe/trunk/test/CodeGen/2002-12-15-GlobalRedefinition.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-12-15-GlobalRedefinition.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-12-15-GlobalRedefinition.c (added)
+++ cfe/trunk/test/CodeGen/2002-12-15-GlobalRedefinition.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+extern char algbrfile[9];
+char algbrfile[9] = "abcdefgh";
+

Added: cfe/trunk/test/CodeGen/2002-12-15-StructParameters.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2002-12-15-StructParameters.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2002-12-15-StructParameters.c (added)
+++ cfe/trunk/test/CodeGen/2002-12-15-StructParameters.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+typedef struct
+{
+  void *stack;
+  unsigned size;
+  unsigned avail;
+} compile_stack_type;
+
+void foo(void*);
+void bar(compile_stack_type T, unsigned);
+
+void test() {
+  compile_stack_type CST;
+  foo(&CST);
+
+  bar(CST, 12);
+}

Added: cfe/trunk/test/CodeGen/2003-01-30-UnionInit.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-01-30-UnionInit.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-01-30-UnionInit.c (added)
+++ cfe/trunk/test/CodeGen/2003-01-30-UnionInit.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -emit-llvm %s -o /dev/null
+
+union foo {
+  struct { char A, B; } X;
+  int C;
+};
+
+union foo V = { {1, 2} };

Added: cfe/trunk/test/CodeGen/2003-03-03-DeferredType.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-03-03-DeferredType.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-03-03-DeferredType.c (added)
+++ cfe/trunk/test/CodeGen/2003-03-03-DeferredType.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+
+
+
+struct foo A;
+
+struct foo {
+  int x;
+double D;
+};
+

Added: cfe/trunk/test/CodeGen/2003-06-22-UnionCrash.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-06-22-UnionCrash.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-06-22-UnionCrash.c (added)
+++ cfe/trunk/test/CodeGen/2003-06-22-UnionCrash.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+struct Blend_Map_Entry {
+  union {
+   float Colour[5];
+   double Point_Slope[2];
+  } Vals;
+};
+
+void test(struct Blend_Map_Entry* Foo)
+{
+}
+

Added: cfe/trunk/test/CodeGen/2003-06-23-GCC-fold-infinite-recursion.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-06-23-GCC-fold-infinite-recursion.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-06-23-GCC-fold-infinite-recursion.c (added)
+++ cfe/trunk/test/CodeGen/2003-06-23-GCC-fold-infinite-recursion.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+double Test(double A, double B, double C, double D) {
+  return -(A-B) - (C-D);
+}
+

Added: cfe/trunk/test/CodeGen/2003-06-26-CFECrash.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-06-26-CFECrash.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-06-26-CFECrash.c (added)
+++ cfe/trunk/test/CodeGen/2003-06-26-CFECrash.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+typedef struct min_info {
+  long offset;
+  unsigned file_attr;
+} min_info;
+
+typedef struct Globals {
+  char answerbuf;
+  min_info info[1];
+  min_info *pInfo;
+} Uz_Globs;
+
+extern Uz_Globs G;
+
+int extract_or_test_files() {  
+  G.pInfo = G.info;
+}
+

Added: cfe/trunk/test/CodeGen/2003-06-29-MultipleFunctionDefinition.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-06-29-MultipleFunctionDefinition.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-06-29-MultipleFunctionDefinition.c (added)
+++ cfe/trunk/test/CodeGen/2003-06-29-MultipleFunctionDefinition.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -std=gnu89 -emit-llvm %s  -o /dev/null
+
+/* This is apparently legal C.
+ */
+extern __inline__ void test() { }
+
+void test() {
+}

Added: cfe/trunk/test/CodeGen/2003-07-22-ArrayAccessTypeSafety.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-07-22-ArrayAccessTypeSafety.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-07-22-ArrayAccessTypeSafety.c (added)
+++ cfe/trunk/test/CodeGen/2003-07-22-ArrayAccessTypeSafety.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,7 @@
+/* RUN: %clang_cc1  %s -emit-llvm -o - | grep -v alloca | not grep bitcast
+ */
+
+void test(int* array, long long N) {
+    array[N] = N[array] = 33;
+}
+

Added: cfe/trunk/test/CodeGen/2003-08-06-BuiltinSetjmpLongjmp.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-08-06-BuiltinSetjmpLongjmp.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-08-06-BuiltinSetjmpLongjmp.c (added)
+++ cfe/trunk/test/CodeGen/2003-08-06-BuiltinSetjmpLongjmp.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,14 @@
+/* RUN: %clang_cc1  %s -emit-llvm -o - | not grep __builtin_
+ *
+ * __builtin_longjmp/setjmp should get transformed into llvm.setjmp/longjmp 
+ * just like explicit setjmp/longjmp calls are.
+ */
+
+void jumpaway(int *ptr) {
+  __builtin_longjmp(ptr,1);
+}
+    
+int main(void) {
+  __builtin_setjmp(0);
+  jumpaway(0);
+}

Added: cfe/trunk/test/CodeGen/2003-08-17-DeadCodeShortCircuit.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-08-17-DeadCodeShortCircuit.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-08-17-DeadCodeShortCircuit.c (added)
+++ cfe/trunk/test/CodeGen/2003-08-17-DeadCodeShortCircuit.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -x c %s -emit-llvm -o /dev/null
+
+int test(_Bool pos, _Bool color) {
+  return 0;
+  return (pos && color);
+}

Added: cfe/trunk/test/CodeGen/2003-08-18-StructAsValue.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-08-18-StructAsValue.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-08-18-StructAsValue.c (added)
+++ cfe/trunk/test/CodeGen/2003-08-18-StructAsValue.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+
+typedef struct {
+  int op;
+} event_t;
+
+event_t test(int X) {
+  event_t foo = { 1 }, bar = { 2 };
+  return X ? foo : bar;
+}

Added: cfe/trunk/test/CodeGen/2003-08-20-BadBitfieldRef.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-08-20-BadBitfieldRef.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-08-20-BadBitfieldRef.c (added)
+++ cfe/trunk/test/CodeGen/2003-08-20-BadBitfieldRef.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+void foo()
+{
+  char *ap;
+  ap[1] == '-' && ap[2] == 0;
+}
+

Added: cfe/trunk/test/CodeGen/2003-08-20-PrototypeMismatch.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-08-20-PrototypeMismatch.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-08-20-PrototypeMismatch.c (added)
+++ cfe/trunk/test/CodeGen/2003-08-20-PrototypeMismatch.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+
+
+static int foo(int);
+
+static int foo(C)
+char C;
+{
+  return C;
+}
+
+void test() {
+  foo(7);
+}

Added: cfe/trunk/test/CodeGen/2003-08-20-vfork-bug.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-08-20-vfork-bug.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-08-20-vfork-bug.c (added)
+++ cfe/trunk/test/CodeGen/2003-08-20-vfork-bug.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+extern int vfork(void);
+test() {
+  vfork();
+}

Added: cfe/trunk/test/CodeGen/2003-08-21-BinOp-Type-Mismatch.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-08-21-BinOp-Type-Mismatch.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-08-21-BinOp-Type-Mismatch.c (added)
+++ cfe/trunk/test/CodeGen/2003-08-21-BinOp-Type-Mismatch.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+struct bar;
+
+void foo()
+{
+  unsigned int frame, focus;
+  (struct bar *) focus == (focus ? ((struct bar *) frame) : 0);
+}
+

Added: cfe/trunk/test/CodeGen/2003-08-21-StmtExpr.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-08-21-StmtExpr.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-08-21-StmtExpr.c (added)
+++ cfe/trunk/test/CodeGen/2003-08-21-StmtExpr.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+
+typedef struct {
+  unsigned long val;
+} structty;
+
+void bar(structty new_mask);
+static void foo() {
+  bar(({ structty mask; mask; }));
+}
+

Added: cfe/trunk/test/CodeGen/2003-08-23-LocalUnionTest.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-08-23-LocalUnionTest.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-08-23-LocalUnionTest.c (added)
+++ cfe/trunk/test/CodeGen/2003-08-23-LocalUnionTest.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+
+
+union foo { int X; };
+
+int test(union foo* F) {
+  {
+    union foo { float X; } A;
+  }
+}

Added: cfe/trunk/test/CodeGen/2003-08-29-BitFieldStruct.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-08-29-BitFieldStruct.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-08-29-BitFieldStruct.c (added)
+++ cfe/trunk/test/CodeGen/2003-08-29-BitFieldStruct.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+struct Word {
+  short bar;
+  short baz;
+  int final:1;
+  short quux;
+} *word_limit;
+
+void foo ()
+{
+  word_limit->final = (word_limit->final && word_limit->final);
+}

Added: cfe/trunk/test/CodeGen/2003-08-29-HugeCharConst.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-08-29-HugeCharConst.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-08-29-HugeCharConst.c (added)
+++ cfe/trunk/test/CodeGen/2003-08-29-HugeCharConst.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+void foo() {
+  unsigned char int_latin1[] = "f\200\372b\200\343\200\340";
+}

Added: cfe/trunk/test/CodeGen/2003-08-30-AggregateInitializer.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-08-30-AggregateInitializer.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-08-30-AggregateInitializer.c (added)
+++ cfe/trunk/test/CodeGen/2003-08-30-AggregateInitializer.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -emit-llvm %s -o /dev/null
+
+struct istruct {
+  unsigned char C;
+};
+
+struct foo {
+  unsigned int I:1;
+  struct istruct J;
+  unsigned char L[1];
+  unsigned int K:1;
+};
+
+struct foo F = { 1, { 7 }, { 123 } , 1 };
+
+

Added: cfe/trunk/test/CodeGen/2003-09-30-StructLayout.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-09-30-StructLayout.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-09-30-StructLayout.c (added)
+++ cfe/trunk/test/CodeGen/2003-09-30-StructLayout.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+enum En {
+  ENUM_VAL
+};
+
+struct St {
+  unsigned char A;
+  enum En B;
+  unsigned char C;
+  enum En D;
+  float E;
+};
+
+
+void func(struct St* A) {
+  A->D = ENUM_VAL;
+}

Added: cfe/trunk/test/CodeGen/2003-10-09-UnionInitializerBug.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-10-09-UnionInitializerBug.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-10-09-UnionInitializerBug.c (added)
+++ cfe/trunk/test/CodeGen/2003-10-09-UnionInitializerBug.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+struct Foo {
+    unsigned a;
+    unsigned b;
+    unsigned c;
+};
+
+struct Bar {
+    union {
+        void **a;
+        struct Foo b;
+    }u;
+};
+
+struct Bar test = {0};
+

Added: cfe/trunk/test/CodeGen/2003-10-28-ident.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-10-28-ident.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-10-28-ident.c (added)
+++ cfe/trunk/test/CodeGen/2003-10-28-ident.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,4 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+
+#ident "foo"

Added: cfe/trunk/test/CodeGen/2003-10-29-AsmRename.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-10-29-AsmRename.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-10-29-AsmRename.c (added)
+++ cfe/trunk/test/CodeGen/2003-10-29-AsmRename.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+
+struct foo { int X; };
+struct bar { int Y; };
+
+extern int Func(struct foo*) __asm__("Func64");
+extern int Func64(struct bar*);
+
+int Func(struct foo *F) {
+  return 1;
+}
+
+int Func64(struct bar* B) {
+  return 0;
+}
+
+
+int test() {
+  Func(0);    /* should be renamed to call Func64 */
+  Func64(0);
+}

Added: cfe/trunk/test/CodeGen/2003-11-01-C99-CompoundLiteral.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-11-01-C99-CompoundLiteral.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-11-01-C99-CompoundLiteral.c (added)
+++ cfe/trunk/test/CodeGen/2003-11-01-C99-CompoundLiteral.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+typedef struct { int foo; } spinlock_t;
+typedef struct wait_queue_head_t { spinlock_t lock; } wait_queue_head_t;
+void call_usermodehelper(void) { 
+  struct wait_queue_head_t work = { lock: (spinlock_t) { 0 }, }; 
+}
+

Added: cfe/trunk/test/CodeGen/2003-11-01-EmptyStructCrash.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-11-01-EmptyStructCrash.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-11-01-EmptyStructCrash.c (added)
+++ cfe/trunk/test/CodeGen/2003-11-01-EmptyStructCrash.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+typedef struct { } the_coolest_struct_in_the_world;
+extern the_coolest_struct_in_the_world xyzzy;
+void *foo() { return &xyzzy; }
+

Added: cfe/trunk/test/CodeGen/2003-11-01-GlobalUnionInit.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-11-01-GlobalUnionInit.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-11-01-GlobalUnionInit.c (added)
+++ cfe/trunk/test/CodeGen/2003-11-01-GlobalUnionInit.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+union bdflush_param {
+    struct { int x; } b_un;
+    int y[1];
+} bdf_prm = {{30}};
+

Added: cfe/trunk/test/CodeGen/2003-11-03-AddrArrayElement.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-11-03-AddrArrayElement.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-11-03-AddrArrayElement.c (added)
+++ cfe/trunk/test/CodeGen/2003-11-03-AddrArrayElement.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
+
+// This should be turned into a tasty getelementptr instruction, not a nasty
+// series of casts and address arithmetic.
+
+char Global[100];
+
+char *test1(unsigned i) {
+  // CHECK: getelementptr
+  return &Global[i];
+}

Added: cfe/trunk/test/CodeGen/2003-11-04-EmptyStruct.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-11-04-EmptyStruct.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-11-04-EmptyStruct.c (added)
+++ cfe/trunk/test/CodeGen/2003-11-04-EmptyStruct.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+typedef struct { } rwlock_t;
+struct fs_struct { rwlock_t lock; int umask; };
+void __copy_fs_struct(struct fs_struct *fs) { fs->lock = (rwlock_t) { }; }
+

Added: cfe/trunk/test/CodeGen/2003-11-04-OutOfMemory.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-11-04-OutOfMemory.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-11-04-OutOfMemory.c (added)
+++ cfe/trunk/test/CodeGen/2003-11-04-OutOfMemory.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+void schedule_timeout(signed long timeout)
+{
+ switch (timeout)
+ {
+ case ((long)(~0UL>>1)): break;
+ }
+}

Added: cfe/trunk/test/CodeGen/2003-11-08-PointerSubNotGetelementptr.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-11-08-PointerSubNotGetelementptr.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-11-08-PointerSubNotGetelementptr.c (added)
+++ cfe/trunk/test/CodeGen/2003-11-08-PointerSubNotGetelementptr.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
+
+char *test(char* C) {
+  // CHECK: getelementptr
+  return C-1;   // Should turn into a GEP
+}
+
+int *test2(int* I) {
+  return I-1;
+}

Added: cfe/trunk/test/CodeGen/2003-11-12-VoidString.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-11-12-VoidString.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-11-12-VoidString.c (added)
+++ cfe/trunk/test/CodeGen/2003-11-12-VoidString.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,4 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+void query_newnamebuf(void) { ((void)"query_newnamebuf"); }
+

Added: cfe/trunk/test/CodeGen/2003-11-18-CondExprLValue.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-11-18-CondExprLValue.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-11-18-CondExprLValue.c (added)
+++ cfe/trunk/test/CodeGen/2003-11-18-CondExprLValue.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+typedef struct { unsigned long pgprot; } pgprot_t;
+
+void split_large_page(unsigned long addr, pgprot_t prot)
+{
+  (addr ? prot : ((pgprot_t) { 0x001 } )).pgprot;
+}
+

Added: cfe/trunk/test/CodeGen/2003-11-19-AddressOfRegister.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-11-19-AddressOfRegister.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-11-19-AddressOfRegister.c (added)
+++ cfe/trunk/test/CodeGen/2003-11-19-AddressOfRegister.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 %s -emit-llvm -o /dev/null
+
+struct item {
+  short delta[4];
+};
+
+int TEST(int nt) {
+ register struct item *aa;
+ aa[nt].delta;
+ return 1;
+}

Added: cfe/trunk/test/CodeGen/2003-11-19-BitFieldArray.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-11-19-BitFieldArray.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-11-19-BitFieldArray.c (added)
+++ cfe/trunk/test/CodeGen/2003-11-19-BitFieldArray.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+struct _GIOChannel {
+  int write_buf;
+  char partial_write_buf[6];
+  int d :1;
+};
+
+void g_io_channel_init (struct _GIOChannel *channel) {
+  channel->partial_write_buf[0];
+}
+

Added: cfe/trunk/test/CodeGen/2003-11-20-Bitfields.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-11-20-Bitfields.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-11-20-Bitfields.c (added)
+++ cfe/trunk/test/CodeGen/2003-11-20-Bitfields.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+struct face_cachel {
+  unsigned int reverse :1;
+  unsigned char font_specified[1];
+};
+
+void
+ensure_face_cachel_contains_charset (struct face_cachel *cachel) {
+  cachel->font_specified[0] = 0;
+}
+

Added: cfe/trunk/test/CodeGen/2003-11-20-ComplexDivision.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-11-20-ComplexDivision.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-11-20-ComplexDivision.c (added)
+++ cfe/trunk/test/CodeGen/2003-11-20-ComplexDivision.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+int test() {
+  __complex__ double C;
+  double D;
+  C / D;
+}

Added: cfe/trunk/test/CodeGen/2003-11-20-UnionBitfield.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-11-20-UnionBitfield.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-11-20-UnionBitfield.c (added)
+++ cfe/trunk/test/CodeGen/2003-11-20-UnionBitfield.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+struct printf_spec {
+  unsigned int minus_flag:1;
+  char converter;
+};
+
+void parse_doprnt_spec () {
+  struct printf_spec spec;
+  spec.minus_flag = 1;
+}
+

Added: cfe/trunk/test/CodeGen/2003-11-26-PointerShift.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-11-26-PointerShift.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-11-26-PointerShift.c (added)
+++ cfe/trunk/test/CodeGen/2003-11-26-PointerShift.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+unsigned long do_csum(const unsigned char *buff, int len, unsigned long result) {
+  if (2 & (unsigned long) buff) result += 1;
+  return result;
+}

Added: cfe/trunk/test/CodeGen/2003-11-27-ConstructorCast.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-11-27-ConstructorCast.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-11-27-ConstructorCast.c (added)
+++ cfe/trunk/test/CodeGen/2003-11-27-ConstructorCast.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+struct i387_soft_struct {
+  long cwd;
+};
+union i387_union {
+  struct i387_soft_struct soft;
+};
+struct thread_struct {
+  union i387_union i387;
+};
+void _init_task_union(void) {
+   struct thread_struct thread = (struct thread_struct) { {{0}} };
+}

Added: cfe/trunk/test/CodeGen/2003-11-27-UnionCtorInitialization.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-11-27-UnionCtorInitialization.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-11-27-UnionCtorInitialization.c (added)
+++ cfe/trunk/test/CodeGen/2003-11-27-UnionCtorInitialization.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+struct i387_soft_struct {
+ long cwd;
+ long twd;
+ long fip;
+};
+union i387_union {
+ struct i387_soft_struct soft;
+};
+struct thread_struct {
+ union i387_union i387;
+};
+void _init_task_union(void) {
+  struct thread_struct thread = (struct thread_struct) { {{0}} };
+}

Added: cfe/trunk/test/CodeGen/2003-12-14-ExternInlineSupport.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2003-12-14-ExternInlineSupport.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2003-12-14-ExternInlineSupport.c (added)
+++ cfe/trunk/test/CodeGen/2003-12-14-ExternInlineSupport.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,3 @@
+// RUN: %clang_cc1 -std=gnu89 %s -emit-llvm -o - | not grep dead_function
+
+extern __inline__ void dead_function() {}

Added: cfe/trunk/test/CodeGen/2004-01-01-UnknownInitSize.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2004-01-01-UnknownInitSize.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2004-01-01-UnknownInitSize.c (added)
+++ cfe/trunk/test/CodeGen/2004-01-01-UnknownInitSize.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -emit-llvm %s -o /dev/null
+
+/*
+ * This regression test ensures that the C front end can compile initializers
+ * even when it cannot determine the size (as below).
+*/
+struct one
+{
+  int a;
+  int values [];
+};
+
+struct one hobbit = {5, {1, 2, 3}};
+

Added: cfe/trunk/test/CodeGen/2004-02-12-LargeAggregateCopy.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2004-02-12-LargeAggregateCopy.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2004-02-12-LargeAggregateCopy.c (added)
+++ cfe/trunk/test/CodeGen/2004-02-12-LargeAggregateCopy.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1  %s -emit-llvm -o - | FileCheck %s
+
+struct X { int V[10000]; };
+struct X Global1, Global2;
+void test() {
+  // CHECK: llvm.memcpy
+  Global2 = Global1;
+}

Added: cfe/trunk/test/CodeGen/2004-02-13-BuiltinFrameReturnAddress.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2004-02-13-BuiltinFrameReturnAddress.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2004-02-13-BuiltinFrameReturnAddress.c (added)
+++ cfe/trunk/test/CodeGen/2004-02-13-BuiltinFrameReturnAddress.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1  %s -emit-llvm -o - | FileCheck %s
+
+void *test1() {
+  // CHECK: call i8* @llvm.returnaddress
+  return __builtin_return_address(1);
+}
+void *test2() {
+  // CHECK: call i8* @llvm.frameaddress
+  return __builtin_frame_address(0);
+}

Added: cfe/trunk/test/CodeGen/2004-02-13-Memset.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2004-02-13-Memset.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2004-02-13-Memset.c (added)
+++ cfe/trunk/test/CodeGen/2004-02-13-Memset.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1  %s -emit-llvm -o - | grep llvm.memset | count 3
+
+void *memset(void*, int, unsigned long);
+void bzero(void*, unsigned long);
+
+void test(int* X, char *Y) {
+  // CHECK: call i8* llvm.memset
+  memset(X, 4, 1000);
+  // CHECK: call void bzero
+  bzero(Y, 100);
+}

Added: cfe/trunk/test/CodeGen/2004-02-14-ZeroInitializer.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2004-02-14-ZeroInitializer.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2004-02-14-ZeroInitializer.c (added)
+++ cfe/trunk/test/CodeGen/2004-02-14-ZeroInitializer.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,4 @@
+// RUN: %clang_cc1  %s -emit-llvm -o - | FileCheck %s
+
+// CHECK: zeroinitializer
+int X[1000];

Added: cfe/trunk/test/CodeGen/2004-03-07-ComplexDivEquals.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2004-03-07-ComplexDivEquals.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2004-03-07-ComplexDivEquals.c (added)
+++ cfe/trunk/test/CodeGen/2004-03-07-ComplexDivEquals.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+
+void test(__complex__ double D, double X) {
+  D /= X;
+}

Added: cfe/trunk/test/CodeGen/2004-03-07-ExternalConstant.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2004-03-07-ExternalConstant.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2004-03-07-ExternalConstant.c (added)
+++ cfe/trunk/test/CodeGen/2004-03-07-ExternalConstant.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1  %s -emit-llvm -o - | FileCheck %s
+
+// CHECK: @a = external constan
+extern const int a[];   // 'a' should be marked constant even though it's external!
+int foo () {
+  return a[0];
+}

Added: cfe/trunk/test/CodeGen/2004-03-09-LargeArrayInitializers.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2004-03-09-LargeArrayInitializers.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2004-03-09-LargeArrayInitializers.c (added)
+++ cfe/trunk/test/CodeGen/2004-03-09-LargeArrayInitializers.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,32 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+// Test that these initializers are handled efficiently
+
+int test(int x) {
+  const int XX[1000] = { 0, 0 };
+  const char S [1000] = "foo";
+
+  const int array[] = {
+     17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 
+     17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 
+     17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 
+     17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 
+     17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 
+     17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 
+     17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 
+     17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 
+     17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 
+     17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 
+     17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 
+     17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 
+     17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 
+     17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 
+     17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 
+     17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 
+     17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 
+     17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 
+     17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 
+     17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 
+   };
+   return array[x];
+} 

Added: cfe/trunk/test/CodeGen/2004-03-16-AsmRegisterCrash.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2004-03-16-AsmRegisterCrash.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2004-03-16-AsmRegisterCrash.c (added)
+++ cfe/trunk/test/CodeGen/2004-03-16-AsmRegisterCrash.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+int foo() {
+#ifdef __ppc__
+  register int X __asm__("r1");
+#else
+  register int X __asm__("ebx");
+#endif
+  return X;
+}

Added: cfe/trunk/test/CodeGen/2004-05-07-VarArrays.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2004-05-07-VarArrays.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2004-05-07-VarArrays.c (added)
+++ cfe/trunk/test/CodeGen/2004-05-07-VarArrays.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+int foo(int len, char arr[][len], int X) {
+  return arr[X][0];
+}

Added: cfe/trunk/test/CodeGen/2004-05-21-IncompleteEnum.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2004-05-21-IncompleteEnum.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2004-05-21-IncompleteEnum.c (added)
+++ cfe/trunk/test/CodeGen/2004-05-21-IncompleteEnum.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -w -emit-llvm %s  -o /dev/null
+
+void test(enum foo *X) {
+}
+

Added: cfe/trunk/test/CodeGen/2004-06-08-OpaqueStructArg.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2004-06-08-OpaqueStructArg.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2004-06-08-OpaqueStructArg.c (added)
+++ cfe/trunk/test/CodeGen/2004-06-08-OpaqueStructArg.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+   struct fu;
+   void foo(struct fu);
+   void bar() {
+      foo;
+   }

Added: cfe/trunk/test/CodeGen/2004-06-17-UnorderedBuiltins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2004-06-17-UnorderedBuiltins.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2004-06-17-UnorderedBuiltins.c (added)
+++ cfe/trunk/test/CodeGen/2004-06-17-UnorderedBuiltins.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,24 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+
+_Bool A, B, C, D, E, F, G, H;
+void TestF(float X, float Y) {
+  A = __builtin_isgreater(X, Y);
+  B = __builtin_isgreaterequal(X, Y);
+  C = __builtin_isless(X, Y);
+  D = __builtin_islessequal(X, Y);
+  E = __builtin_islessgreater(X, Y);
+  F = __builtin_isunordered(X, Y);
+  //G = __builtin_isordered(X, Y);    // Our current snapshot of GCC doesn't include this builtin
+  H = __builtin_isunordered(X, Y);
+}
+void TestD(double X, double Y) {
+  A = __builtin_isgreater(X, Y);
+  B = __builtin_isgreaterequal(X, Y);
+  C = __builtin_isless(X, Y);
+  D = __builtin_islessequal(X, Y);
+  E = __builtin_islessgreater(X, Y);
+  F = __builtin_isunordered(X, Y);
+  //G = __builtin_isordered(X, Y);    // Our current snapshot doesn't include this builtin.  FIXME
+  H = __builtin_isunordered(X, Y);
+}

Added: cfe/trunk/test/CodeGen/2004-06-18-VariableLengthArrayOfStructures.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2004-06-18-VariableLengthArrayOfStructures.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2004-06-18-VariableLengthArrayOfStructures.c (added)
+++ cfe/trunk/test/CodeGen/2004-06-18-VariableLengthArrayOfStructures.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+
+struct S { };
+
+int xxxx(int a) {
+  struct S comps[a];
+  comps[0];
+}
+

Added: cfe/trunk/test/CodeGen/2004-07-06-FunctionCast.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2004-07-06-FunctionCast.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2004-07-06-FunctionCast.c (added)
+++ cfe/trunk/test/CodeGen/2004-07-06-FunctionCast.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+static int unused_func(void) {
+  return 1;
+}
+
+int foo(void) {
+  (void)unused_func; /* avoid compiler warning */
+  return 2;
+}

Added: cfe/trunk/test/CodeGen/2004-08-06-LargeStructTest.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2004-08-06-LargeStructTest.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2004-08-06-LargeStructTest.c (added)
+++ cfe/trunk/test/CodeGen/2004-08-06-LargeStructTest.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+
+
+#define A(X) int X;
+#define B(X) A(X##0) A(X##1) A(X##2) A(X##3) A(X##4) A(X##5) A(X##6) A(X##7) \
+             A(X##8) A(X##9) A(X##A) A(X##B) A(X##C) A(X##D) A(X##E) A(X##F)
+#define C(X) B(X##0) B(X##1) B(X##2) B(X##3) B(X##4) B(X##5) B(X##6) B(X##7) \
+             B(X##8) B(X##9) B(X##A) B(X##B) B(X##C) B(X##D) B(X##E) B(X##F)
+
+struct foo {
+  C(x);   // 256
+  C(y);   // 256
+  C(z);
+};
+
+
+int test(struct foo *F) {
+   return F->xA1 + F->yFF + F->zC4;
+}

Added: cfe/trunk/test/CodeGen/2004-11-25-UnnamedBitfieldPadding.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2004-11-25-UnnamedBitfieldPadding.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2004-11-25-UnnamedBitfieldPadding.c (added)
+++ cfe/trunk/test/CodeGen/2004-11-25-UnnamedBitfieldPadding.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -emit-llvm %s -o /dev/null
+// This is a testcase for PR461
+typedef struct {
+  unsigned min_align: 1;
+  unsigned : 1;
+} addr_diff_vec_flags;
+
+addr_diff_vec_flags X;

Added: cfe/trunk/test/CodeGen/2004-11-27-StaticFunctionRedeclare.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2004-11-27-StaticFunctionRedeclare.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2004-11-27-StaticFunctionRedeclare.c (added)
+++ cfe/trunk/test/CodeGen/2004-11-27-StaticFunctionRedeclare.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - | \
+// RUN:   opt -std-compile-opts -emit-llvm | not grep {declare i32.*func}
+
+// There should not be an unresolved reference to func here.  Believe it or not,
+// the "expected result" is a function named 'func' which is internal and 
+// referenced by bar().
+
+// This is PR244
+
+static int func();
+void bar() {
+  int func();
+  foo(func);
+}
+static int func(char** A, char ** B) {}

Added: cfe/trunk/test/CodeGen/2005-01-02-ConstantInits.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2005-01-02-ConstantInits.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2005-01-02-ConstantInits.c (added)
+++ cfe/trunk/test/CodeGen/2005-01-02-ConstantInits.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,24 @@
+// RUN: %clang_cc1 %s -emit-llvm -o -
+
+// This tests all kinds of hard cases with initializers and
+// array subscripts.  This corresponds to PR487.
+
+struct X { int a[2]; };
+
+int test() {
+  static int i23 = (int) &(((struct X *)0)->a[1]);
+  return i23;
+}
+
+int i = (int) &( ((struct X *)0) -> a[1]);
+
+int Arr[100];
+
+int foo(int i) { return bar(&Arr[49])+bar(&Arr[i]); }
+int foo2(int i) { 
+  static const int *X = &Arr[49];
+   static int i23 = (int) &( ((struct X *)0) -> a[0]);
+  int *P = Arr;
+  ++P;
+  return bar(Arr+i);
+}

Added: cfe/trunk/test/CodeGen/2005-01-02-PointerDifference.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2005-01-02-PointerDifference.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2005-01-02-PointerDifference.c (added)
+++ cfe/trunk/test/CodeGen/2005-01-02-PointerDifference.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,4 @@
+// RUN: %clang_cc1  %s -emit-llvm -o - | FileCheck %s
+
+// CHECK: sdiv exact
+int Diff(int *P, int *Q) { return P-Q; }

Added: cfe/trunk/test/CodeGen/2005-02-27-MarkGlobalConstant.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2005-02-27-MarkGlobalConstant.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2005-02-27-MarkGlobalConstant.c (added)
+++ cfe/trunk/test/CodeGen/2005-02-27-MarkGlobalConstant.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1  %s -emit-llvm -o - | FileCheck %s
+// XFAIL: *
+// PR10414
+
+// The synthetic global made by the CFE for big initializer should be marked
+// constant.
+
+void bar();
+void foo() {
+  // CHECK: private unnamed_addr constant
+  char Blah[] = "asdlfkajsdlfkajsd;lfkajds;lfkjasd;flkajsd;lkfja;sdlkfjasd";
+  bar(Blah);
+}

Added: cfe/trunk/test/CodeGen/2005-03-05-OffsetOfHack.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2005-03-05-OffsetOfHack.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2005-03-05-OffsetOfHack.c (added)
+++ cfe/trunk/test/CodeGen/2005-03-05-OffsetOfHack.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - 
+
+struct s {
+  unsigned long int field[0];
+};
+
+#define OFFS \
+        (((char *) &((struct s *) 0)->field[0]) - (char *) 0)
+
+int foo[OFFS];
+
+

Added: cfe/trunk/test/CodeGen/2005-03-06-OffsetOfStructCrash.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2005-03-06-OffsetOfStructCrash.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2005-03-06-OffsetOfStructCrash.c (added)
+++ cfe/trunk/test/CodeGen/2005-03-06-OffsetOfStructCrash.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 %s -emit-llvm -o -
+
+struct Y {};
+struct XXX {
+  struct  Y F;
+};
+
+void test1() {
+   (int)&((struct XXX*)(((void *)0)))->F;
+}
+
+void test2() {
+   &((struct XXX*)(((void *)0)))->F;
+}

Added: cfe/trunk/test/CodeGen/2005-03-11-Prefetch.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2005-03-11-Prefetch.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2005-03-11-Prefetch.c (added)
+++ cfe/trunk/test/CodeGen/2005-03-11-Prefetch.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
+
+void foo(int *P) {
+  // CHECK: llvm.prefetch
+  __builtin_prefetch(P);
+  __builtin_prefetch(P, 1);
+}

Added: cfe/trunk/test/CodeGen/2005-05-06-CountBuiltins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2005-05-06-CountBuiltins.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2005-05-06-CountBuiltins.c (added)
+++ cfe/trunk/test/CodeGen/2005-05-06-CountBuiltins.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 %s -emit-llvm -o %t
+// RUN: not grep call*__builtin %t
+
+int G, H, I;
+void foo(int P) {
+  G = __builtin_clz(P);
+  H = __builtin_ctz(P);
+  I = __builtin_popcount(P);
+}
+
+long long g, h, i;
+void fooll(float P) {
+  g = __builtin_clzll(P);
+  g = __builtin_clzll(P);
+  h = __builtin_ctzll(P);
+  i = __builtin_popcountll(P);
+}

Added: cfe/trunk/test/CodeGen/2005-05-10-GlobalUnionInit.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2005-05-10-GlobalUnionInit.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2005-05-10-GlobalUnionInit.c (added)
+++ cfe/trunk/test/CodeGen/2005-05-10-GlobalUnionInit.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 %s -emit-llvm -o -
+
+union A {                    // { uint }
+  union B { double *C; } D;
+} E = { { (double*)12312 } };
+

Added: cfe/trunk/test/CodeGen/2005-07-26-UnionInitCrash.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2005-07-26-UnionInitCrash.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2005-07-26-UnionInitCrash.c (added)
+++ cfe/trunk/test/CodeGen/2005-07-26-UnionInitCrash.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,3 @@
+// PR607
+// RUN: %clang_cc1 %s -emit-llvm -o -
+union { char bytes[8]; double alignment; }EQ1 = {0,0,0,0,0,0,0,0};

Added: cfe/trunk/test/CodeGen/2005-07-28-IncorrectWeakGlobal.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2005-07-28-IncorrectWeakGlobal.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2005-07-28-IncorrectWeakGlobal.c (added)
+++ cfe/trunk/test/CodeGen/2005-07-28-IncorrectWeakGlobal.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - | grep TheGlobal | not grep weak
+
+extern int TheGlobal;
+int foo() { return TheGlobal; }
+int TheGlobal = 1;

Added: cfe/trunk/test/CodeGen/2005-09-20-ComplexConstants.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2005-09-20-ComplexConstants.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2005-09-20-ComplexConstants.c (added)
+++ cfe/trunk/test/CodeGen/2005-09-20-ComplexConstants.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,4 @@
+// RUN: %clang_cc1 %s -emit-llvm  -o /dev/null
+
+const double _Complex x[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; 
+

Added: cfe/trunk/test/CodeGen/2005-09-24-AsmUserPrefix.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2005-09-24-AsmUserPrefix.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2005-09-24-AsmUserPrefix.c (added)
+++ cfe/trunk/test/CodeGen/2005-09-24-AsmUserPrefix.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - | opt -std-compile-opts | llc | \
+// RUN:    not grep _foo2
+
+void foo() __asm__("foo2");
+
+void bar() {
+  foo();
+}

Added: cfe/trunk/test/CodeGen/2005-09-24-BitFieldCrash.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2005-09-24-BitFieldCrash.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2005-09-24-BitFieldCrash.c (added)
+++ cfe/trunk/test/CodeGen/2005-09-24-BitFieldCrash.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,33 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - 
+
+struct tree_common {};
+
+struct tree_int_cst {
+ struct tree_common common;
+  struct tree_int_cst_lowhi {
+    unsigned long long low;
+    long long high;
+  } int_cst;
+};
+
+enum XXX { yyy };
+
+struct tree_function_decl {
+  struct tree_common common;
+  long long locus, y;
+  __extension__ enum  XXX built_in_class : 2;
+
+};
+
+
+union tree_node {
+  struct tree_int_cst int_cst;
+  struct tree_function_decl function_decl;
+};
+
+
+void foo (union tree_node * decl) {
+  decl->function_decl.built_in_class != 0;
+}
+
+

Added: cfe/trunk/test/CodeGen/2005-12-04-AttributeUsed.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2005-12-04-AttributeUsed.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2005-12-04-AttributeUsed.c (added)
+++ cfe/trunk/test/CodeGen/2005-12-04-AttributeUsed.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
+
+// CHECK: @llvm.used = appending global [2 x i8*] [i8* bitcast (void ()* @foo to i8*), i8* bitcast (i32* @X to i8*)], section "llvm.metadata"
+int X __attribute__((used));
+int Y;
+
+__attribute__((used)) void foo() {}

Added: cfe/trunk/test/CodeGen/2005-12-04-DeclarationLineNumbers.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2005-12-04-DeclarationLineNumbers.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2005-12-04-DeclarationLineNumbers.c (added)
+++ cfe/trunk/test/CodeGen/2005-12-04-DeclarationLineNumbers.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 %s -emit-llvm -g -o - | grep DW_TAG_compile_unit | count 1
+// PR664: ensure that line #'s are emitted for declarations
+
+
+short test(short br_data_0,
+short br_data_1,
+short br_data_2,
+short br_data_3,
+short br_data_4,
+short br_data_5,
+short br_data_6,
+short br_data_7) {
+
+short sm07 = br_data_0 + br_data_7;
+short sm16 = br_data_1 + br_data_6;
+short sm25 = br_data_2 + br_data_5;
+short sm34 = br_data_3 + br_data_4;
+short s0734 = sm07 + sm34;
+short s1625 = sm16 + sm25;
+
+return s0734 + s1625;
+}
+

Added: cfe/trunk/test/CodeGen/2006-01-13-StackSave.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2006-01-13-StackSave.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2006-01-13-StackSave.c (added)
+++ cfe/trunk/test/CodeGen/2006-01-13-StackSave.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,11 @@
+// PR691
+// RUN: %clang_cc1 %s -emit-llvm -o - | opt -std-compile-opts | \
+// RUN:    llvm-dis | grep llvm.stacksave
+
+void test(int N) {
+  int i;
+  for (i = 0; i < N; ++i) {
+    int VLA[i];
+    external(VLA);
+  }
+}

Added: cfe/trunk/test/CodeGen/2006-01-16-BitCountIntrinsicsUnsigned.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2006-01-16-BitCountIntrinsicsUnsigned.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2006-01-16-BitCountIntrinsicsUnsigned.c (added)
+++ cfe/trunk/test/CodeGen/2006-01-16-BitCountIntrinsicsUnsigned.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
+
+unsigned t2(unsigned X) {
+  // CHECK: t2
+  // CHECK: llvm.ctlz.i32
+  return __builtin_clz(X);
+}
+int t1(int X) {
+  // CHECK: t1
+  // CHECK: llvm.ctlz.i32
+  return __builtin_clz(X);
+}

Added: cfe/trunk/test/CodeGen/2006-01-23-FileScopeAsm.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2006-01-23-FileScopeAsm.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2006-01-23-FileScopeAsm.c (added)
+++ cfe/trunk/test/CodeGen/2006-01-23-FileScopeAsm.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
+
+// CHECK: module asm "foo1"
+__asm__ ("foo1");
+// CHECK: module asm "foo2"
+__asm__ ("foo2");
+// CHECK: module asm "foo3"
+__asm__ ("foo3");
+// CHECK: module asm "foo4"
+__asm__ ("foo4");
+// CHECK: module asm "foo5"
+__asm__ ("foo5");

Added: cfe/trunk/test/CodeGen/2006-03-03-MissingInitializer.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2006-03-03-MissingInitializer.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2006-03-03-MissingInitializer.c (added)
+++ cfe/trunk/test/CodeGen/2006-03-03-MissingInitializer.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
+
+struct X { int *XX; int Y;};
+
+void foo() {
+  // CHECK: @foo.nate = internal global i32 0
+  static int nate = 0;
+  struct X bob = { &nate, 14 };
+  bar(&bob);
+}

Added: cfe/trunk/test/CodeGen/2006-03-16-VectorCtor.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2006-03-16-VectorCtor.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2006-03-16-VectorCtor.c (added)
+++ cfe/trunk/test/CodeGen/2006-03-16-VectorCtor.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,10 @@
+// Test that basic generic vector support works
+// RUN: %clang_cc1 %s -emit-llvm -o -
+
+typedef int v4si __attribute__ ((__vector_size__ (16)));
+void test(v4si *P, v4si *Q, float X) {
+  *P = (v4si){ X, X, X, X } * *Q;
+}
+
+v4si G = (v4si){ 0.1, 1.2, 4.2, 17.2 };
+

Added: cfe/trunk/test/CodeGen/2006-03-17-KnRMismatch.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2006-03-17-KnRMismatch.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2006-03-17-KnRMismatch.c (added)
+++ cfe/trunk/test/CodeGen/2006-03-17-KnRMismatch.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 %s -emit-llvm -o -
+
+void regnode(int op);
+
+void regnode(op)
+char op;
+{
+}

Added: cfe/trunk/test/CodeGen/2006-05-19-SingleEltReturn.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2006-05-19-SingleEltReturn.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2006-05-19-SingleEltReturn.c (added)
+++ cfe/trunk/test/CodeGen/2006-05-19-SingleEltReturn.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,23 @@
+// Test returning a single element aggregate value containing a double.
+// RUN: %clang_cc1 %s -emit-llvm -o -
+
+struct X {
+  double D;
+};
+
+struct Y { 
+  struct X x; 
+};
+
+struct Y bar();
+
+void foo(struct Y *P) {
+  *P = bar();
+}
+
+struct Y bar() {
+  struct Y a;
+  a.x.D = 0;
+  return a;
+}
+

Added: cfe/trunk/test/CodeGen/2006-07-31-PR854.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2006-07-31-PR854.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2006-07-31-PR854.c (added)
+++ cfe/trunk/test/CodeGen/2006-07-31-PR854.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -triple i686-linux-gnu -w %s -emit-llvm -o -
+
+// PR854
+  struct kernel_symbol {
+    unsigned long value;
+  };
+  unsigned long loops_per_jiffy = (1<<12);
+  static const char __kstrtab_loops_per_jiffy[]
+__attribute__((section("__ksymtab_strings"))) = "loops_per_jiffy";
+  static const struct kernel_symbol __ksymtab_loops_per_jiffy
+__attribute__((__used__)) __attribute__((section("__ksymtab"))) = { (unsigned
+long)&loops_per_jiffy, __kstrtab_loops_per_jiffy };

Added: cfe/trunk/test/CodeGen/2006-09-11-BitfieldRefCrash.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2006-09-11-BitfieldRefCrash.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2006-09-11-BitfieldRefCrash.c (added)
+++ cfe/trunk/test/CodeGen/2006-09-11-BitfieldRefCrash.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 %s -emit-llvm -o -
+// PR906
+
+struct state_struct {
+  unsigned long long phys_frame: 50;
+  unsigned valid : 2;
+} s;
+
+int mem_access(struct state_struct *p) {
+  return p->valid;
+}
+

Added: cfe/trunk/test/CodeGen/2006-09-18-fwrite-cast-crash.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2006-09-18-fwrite-cast-crash.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2006-09-18-fwrite-cast-crash.c (added)
+++ cfe/trunk/test/CodeGen/2006-09-18-fwrite-cast-crash.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 %s -emit-llvm -o /dev/null
+// PR910
+
+struct l_struct_2E_FILE { char x; };
+unsigned fwrite(signed char *, unsigned , unsigned , signed char *);
+static signed char str301[39];
+static void Usage(signed char *ltmp_611_6) {
+  struct l_struct_2E_FILE *ltmp_6202_16;
+  unsigned ltmp_6203_92;
+  ltmp_6203_92 =  /*tail*/ ((unsigned  (*) (signed char *, unsigned , unsigned ,
+struct l_struct_2E_FILE *))(void*)fwrite)((&(str301[0u])), 38u, 1u, ltmp_6202_16);
+}

Added: cfe/trunk/test/CodeGen/2006-09-21-IncompleteElementType.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2006-09-21-IncompleteElementType.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2006-09-21-IncompleteElementType.c (added)
+++ cfe/trunk/test/CodeGen/2006-09-21-IncompleteElementType.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,3 @@
+// RUN: not %clang_cc1 %s -emit-llvm -o /dev/null
+
+struct A X[(927 - 37) / sizeof(struct A)];

Added: cfe/trunk/test/CodeGen/2006-09-25-DebugFilename.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2006-09-25-DebugFilename.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2006-09-25-DebugFilename.c (added)
+++ cfe/trunk/test/CodeGen/2006-09-25-DebugFilename.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,4 @@
+// RUN: not %clang_cc1  %s -emit-llvm -o /dev/null
+#include "2006-09-25-DebugFilename.h"
+int func1() { return hfunc1(); }
+int func2() { fluffy; return hfunc1(); } // expected-error {{use of undeclared identifier 'fluffy'}}

Added: cfe/trunk/test/CodeGen/2006-09-25-DebugFilename.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2006-09-25-DebugFilename.h?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2006-09-25-DebugFilename.h (added)
+++ cfe/trunk/test/CodeGen/2006-09-25-DebugFilename.h Tue Jul 26 17:17:02 2011
@@ -0,0 +1,6 @@
+extern int exfunc(int a);
+
+static inline int hfunc1()
+{
+  return exfunc(1);
+}

Added: cfe/trunk/test/CodeGen/2006-09-28-SimpleAsm.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2006-09-28-SimpleAsm.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2006-09-28-SimpleAsm.c (added)
+++ cfe/trunk/test/CodeGen/2006-09-28-SimpleAsm.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
+// PR924
+
+void bar() {
+  // Extended asm
+  // CHECK: call void asm sideeffect "ext: xorl %eax, eax; movl eax, fs; movl eax, gs  %blah
+  asm volatile ("ext: xorl %%eax, eax; movl eax, fs; movl eax, gs  %%blah %= %\
+% " : : "r"(1));
+  // CHECK: call void asm sideeffect "nonext: xorl %eax, %eax; movl %eax, %fs; movl %eax, %gs  %%blah %= %%
+  // Non-extended asm.
+  asm volatile ("nonext: xorl %eax, %eax; movl %eax, %fs; movl %eax, %gs  %%blah %= %% ");
+}

Added: cfe/trunk/test/CodeGen/2006-10-30-ArrayCrash.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2006-10-30-ArrayCrash.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2006-10-30-ArrayCrash.c (added)
+++ cfe/trunk/test/CodeGen/2006-10-30-ArrayCrash.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -O3 -emit-llvm -o - %s
+// PR954, PR911
+
+extern void foo();
+
+struct S {
+  short        f1[3];
+  unsigned int f2 : 1;
+};
+
+void bar()
+{
+  struct S *A;
+
+  if (A->f2)
+    foo();
+}

Added: cfe/trunk/test/CodeGen/2006-12-14-ordered_expr.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2006-12-14-ordered_expr.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2006-12-14-ordered_expr.c (added)
+++ cfe/trunk/test/CodeGen/2006-12-14-ordered_expr.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -O3 -emit-llvm %s -o - | FileCheck %s
+
+int test2(float X, float Y) {
+  // CHECK: fcmp ord float %X, %Y
+  return !__builtin_isunordered(X, Y);
+}

Added: cfe/trunk/test/CodeGen/2007-01-06-KNR-Proto.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-01-06-KNR-Proto.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-01-06-KNR-Proto.c (added)
+++ cfe/trunk/test/CodeGen/2007-01-06-KNR-Proto.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -emit-llvm -o - %s
+// PR1083
+
+int svc_register (void (*dispatch) (int));
+
+int svc_register (dispatch)
+     void (*dispatch) ();
+{
+}
+

Added: cfe/trunk/test/CodeGen/2007-01-20-VectorICE.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-01-20-VectorICE.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-01-20-VectorICE.c (added)
+++ cfe/trunk/test/CodeGen/2007-01-20-VectorICE.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - 
+
+typedef float __m128 __attribute__((__vector_size__(16)));
+typedef long long __v2di __attribute__((__vector_size__(16)));
+typedef int __v4si __attribute__((__vector_size__(16)));
+
+__v2di  bar(void);
+void foo(int X, __v4si *P) {
+	*P = X == 2 ? bar() : bar();
+}
+

Added: cfe/trunk/test/CodeGen/2007-01-24-InlineAsmCModifier.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-01-24-InlineAsmCModifier.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-01-24-InlineAsmCModifier.c (added)
+++ cfe/trunk/test/CodeGen/2007-01-24-InlineAsmCModifier.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,12 @@
+// Verify that the %c modifier works and strips off any prefixes from
+// immediates.
+// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
+
+void foo() {
+  // CHECK: i32 789514
+  __asm__         volatile("/* " "pickANumber" ": %c0 */"::"i"(0xC0C0A));
+
+  // Check that non-c modifiers work also
+  // CHECK: i32 123
+   __asm__         volatile("/* " "pickANumber2 " ": %0 */"::"i"(123));
+}

Added: cfe/trunk/test/CodeGen/2007-02-04-AddrLValue-2.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-02-04-AddrLValue-2.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-02-04-AddrLValue-2.c (added)
+++ cfe/trunk/test/CodeGen/2007-02-04-AddrLValue-2.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 %s -O3 -emit-llvm -o -
+// PR1173
+
+struct S { char s; };
+struct T { struct S t; };
+
+struct S *const p = &((struct T * const) (0x4000))->t;
+
+void
+foo (void)
+{
+  p->s = 0;
+}

Added: cfe/trunk/test/CodeGen/2007-02-04-AddrLValue.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-02-04-AddrLValue.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-02-04-AddrLValue.c (added)
+++ cfe/trunk/test/CodeGen/2007-02-04-AddrLValue.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 %s -O3 -emit-llvm -o -
+// PR1176
+
+typedef struct
+{
+  char *key;
+  char *value;
+} T1;
+
+typedef struct
+{
+  long type;
+  char *value;
+} T3;
+
+T1 a[] =
+{
+  {
+    "",
+    ((char *)&((T3) {1, (char *) 1}))
+  }
+};
+

Added: cfe/trunk/test/CodeGen/2007-02-04-EmptyStruct.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-02-04-EmptyStruct.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-02-04-EmptyStruct.c (added)
+++ cfe/trunk/test/CodeGen/2007-02-04-EmptyStruct.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 %s -O3 -emit-llvm -o -
+// PR1175
+
+struct empty { };
+
+void foo(struct empty *p) {
+   p++;
+}
+

Added: cfe/trunk/test/CodeGen/2007-02-16-VoidPtrDiff.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-02-16-VoidPtrDiff.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-02-16-VoidPtrDiff.c (added)
+++ cfe/trunk/test/CodeGen/2007-02-16-VoidPtrDiff.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 %s -emit-llvm -o -
+
+void foo(void *ptr, int test) {
+  (ptr - ((void *) test + 0x2000));
+}

Added: cfe/trunk/test/CodeGen/2007-02-25-C-DotDotDot.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-02-25-C-DotDotDot.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-02-25-C-DotDotDot.c (added)
+++ cfe/trunk/test/CodeGen/2007-02-25-C-DotDotDot.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -O0 %s -emit-llvm -o - | FileCheck %s
+
+// Make sure the call to foo is compiled as:
+//  call float @foo()
+// not
+//  call float (...)* bitcast (float ()* @foo to float (...)*)( )
+
+static float foo() { return 0.0; }
+// CHECK: call float @foo
+float bar() { return foo()*10.0;}

Added: cfe/trunk/test/CodeGen/2007-03-01-VarSizeArrayIdx.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-03-01-VarSizeArrayIdx.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-03-01-VarSizeArrayIdx.c (added)
+++ cfe/trunk/test/CodeGen/2007-03-01-VarSizeArrayIdx.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 %s -O3 -emit-llvm -o - | grep mul
+// PR1233
+
+float foo(int w, float A[][w], int g, int h) {
+  return A[g][0];
+}
+

Added: cfe/trunk/test/CodeGen/2007-03-26-BitfieldAfterZeroWidth.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-03-26-BitfieldAfterZeroWidth.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-03-26-BitfieldAfterZeroWidth.c (added)
+++ cfe/trunk/test/CodeGen/2007-03-26-BitfieldAfterZeroWidth.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 %s -emit-llvm -o -
+struct W {};
+struct Y {
+  struct W w;
+  int i:1;
+} __attribute__ ((packed)) y;

Added: cfe/trunk/test/CodeGen/2007-03-26-ZeroWidthBitfield.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-03-26-ZeroWidthBitfield.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-03-26-ZeroWidthBitfield.c (added)
+++ cfe/trunk/test/CodeGen/2007-03-26-ZeroWidthBitfield.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,2 @@
+// RUN: %clang_cc1 %s -emit-llvm -o -
+struct Z { int :0; } z;

Added: cfe/trunk/test/CodeGen/2007-03-27-VarLengthArray.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-03-27-VarLengthArray.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-03-27-VarLengthArray.c (added)
+++ cfe/trunk/test/CodeGen/2007-03-27-VarLengthArray.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
+
+// CHECK: getelementptr inbounds i32* %vla
+extern void f(int *);
+int e(int m, int n) {
+  int x[n];
+  f(x);
+  return x[m];
+}

Added: cfe/trunk/test/CodeGen/2007-04-05-PackedBitFields-2.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-04-05-PackedBitFields-2.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-04-05-PackedBitFields-2.c (added)
+++ cfe/trunk/test/CodeGen/2007-04-05-PackedBitFields-2.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 %s -emit-llvm -o -
+
+# define pck __attribute__((packed))
+
+
+struct pck F { 
+  unsigned long long i : 12, 
+    j : 23, 
+    k : 27, 
+    l; 
+}; 
+struct F f1;
+
+void foo() {
+	f1.l = 5;
+}

Added: cfe/trunk/test/CodeGen/2007-04-05-PackedBitFields.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-04-05-PackedBitFields.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-04-05-PackedBitFields.c (added)
+++ cfe/trunk/test/CodeGen/2007-04-05-PackedBitFields.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 %s -emit-llvm -o -
+
+# define pck __attribute__((packed))
+
+
+struct pck E { 
+  unsigned long long l, 
+    i : 12, 
+    j : 23, 
+    k : 29; };
+
+struct E e1;
+
+void foo() {
+	e1.k = 5;
+}

Added: cfe/trunk/test/CodeGen/2007-04-05-PackedStruct.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-04-05-PackedStruct.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-04-05-PackedStruct.c (added)
+++ cfe/trunk/test/CodeGen/2007-04-05-PackedStruct.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 %s -emit-llvm -o -
+
+#pragma pack(push, 2)
+
+enum {
+  tA = 0,
+  tB = 1
+};
+
+struct MyStruct {
+  unsigned long A;
+  char C;
+  void * B;
+};
+
+void bar(){
+struct MyStruct MS = { tB, 0 };
+}

Added: cfe/trunk/test/CodeGen/2007-04-05-PadBeforeZeroLengthField.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-04-05-PadBeforeZeroLengthField.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-04-05-PadBeforeZeroLengthField.c (added)
+++ cfe/trunk/test/CodeGen/2007-04-05-PadBeforeZeroLengthField.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 %s -emit-llvm -o -
+struct c__ { unsigned int type:4; };
+union A { struct c__ c;  } __attribute__((aligned(8)));
+struct B {
+    unsigned int retainCount;
+    union A objects[];
+};
+void foo(union A * objects, struct B *array, unsigned long k)
+{  array->objects[k] = objects[k]; }

Added: cfe/trunk/test/CodeGen/2007-04-11-InlineAsmStruct.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-04-11-InlineAsmStruct.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-04-11-InlineAsmStruct.c (added)
+++ cfe/trunk/test/CodeGen/2007-04-11-InlineAsmStruct.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 %s -emit-llvm -o -
+
+struct V { short X, Y; };
+int bar() {
+  struct V bar;
+  __asm__ volatile("foo %0\n" : "=r"(bar));
+  return bar.X;
+}

Added: cfe/trunk/test/CodeGen/2007-04-11-InlineAsmUnion.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-04-11-InlineAsmUnion.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-04-11-InlineAsmUnion.c (added)
+++ cfe/trunk/test/CodeGen/2007-04-11-InlineAsmUnion.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 %s -emit-llvm -o -
+
+union U { int x; float p; };
+void foo() {
+  union U bar;
+  __asm__ volatile("foo %0\n" : "=r"(bar));
+}

Added: cfe/trunk/test/CodeGen/2007-04-13-InlineAsmStruct2.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-04-13-InlineAsmStruct2.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-04-13-InlineAsmStruct2.c (added)
+++ cfe/trunk/test/CodeGen/2007-04-13-InlineAsmStruct2.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
+
+struct V { short X, Y; };
+int bar() {
+  struct V bar;
+  // CHECK: call void asm
+  __asm__ volatile("foo %0\n" :: "r"(bar));
+  return bar.X;
+}

Added: cfe/trunk/test/CodeGen/2007-04-13-InlineAsmUnion2.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-04-13-InlineAsmUnion2.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-04-13-InlineAsmUnion2.c (added)
+++ cfe/trunk/test/CodeGen/2007-04-13-InlineAsmUnion2.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
+
+union U { int x; char* p; };
+void foo() {
+  union U bar;
+  // CHECK: call void asm
+  __asm__ volatile("foo %0\n" :: "r"(bar));
+}

Added: cfe/trunk/test/CodeGen/2007-04-14-FNoBuiltin.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-04-14-FNoBuiltin.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-04-14-FNoBuiltin.c (added)
+++ cfe/trunk/test/CodeGen/2007-04-14-FNoBuiltin.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -emit-llvm %s -O2 -fno-builtin -o - | grep call.*printf
+// Check that -fno-builtin is honored.
+
+extern int printf(const char*, ...);
+void foo(const char *msg) {
+	printf("%s\n",msg);
+}

Added: cfe/trunk/test/CodeGen/2007-04-17-ZeroSizeBitFields.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-04-17-ZeroSizeBitFields.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-04-17-ZeroSizeBitFields.c (added)
+++ cfe/trunk/test/CodeGen/2007-04-17-ZeroSizeBitFields.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,4 @@
+// PR 1332
+// RUN: %clang_cc1 %s -emit-llvm -o /dev/null
+
+struct Z { int a:1; int :0; int c:1; } z;

Added: cfe/trunk/test/CodeGen/2007-04-24-bit-not-expr.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-04-24-bit-not-expr.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-04-24-bit-not-expr.c (added)
+++ cfe/trunk/test/CodeGen/2007-04-24-bit-not-expr.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,7 @@
+// PR 1346
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+extern bar(void *);
+
+void f(void *cd) {
+  bar(((void *)((unsigned long)(cd) ^ -1)));
+}

Added: cfe/trunk/test/CodeGen/2007-05-07-PaddingElements.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-05-07-PaddingElements.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-05-07-PaddingElements.c (added)
+++ cfe/trunk/test/CodeGen/2007-05-07-PaddingElements.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,12 @@
+// PR 1278
+// RUN: %clang_cc1 %s -emit-llvm -O0 -o - | grep {struct.s} | not grep "4 x i8] zeroinitializer"
+// RUN: %clang_cc1 %s -emit-llvm -O0 -o - | not grep "i32 0, i32 2"
+struct s {
+  double d1;
+  int s1;
+};
+
+struct s foo(void) {
+  struct s S = {1.1, 2};
+  return S;
+}

Added: cfe/trunk/test/CodeGen/2007-05-08-PCH.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-05-08-PCH.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-05-08-PCH.c (added)
+++ cfe/trunk/test/CodeGen/2007-05-08-PCH.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,7 @@
+// PR 1400
+// RUN: %clang_cc1 -x c-header %s -o /dev/null
+
+int main() {
+  return 0;
+}
+

Added: cfe/trunk/test/CodeGen/2007-05-15-PaddingElement.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-05-15-PaddingElement.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-05-15-PaddingElement.c (added)
+++ cfe/trunk/test/CodeGen/2007-05-15-PaddingElement.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,23 @@
+// PR 1419
+
+// RUN: %clang_cc1   -O2 %s -emit-llvm -o - | grep "ret i32 1"
+struct A {
+  short x;
+  long long :0;
+};
+
+struct B {
+  char a;
+  char b;
+  unsigned char i;
+};
+
+union X { struct A a; struct B b; };
+
+int check(void) {
+  union X x, y;
+
+  y.b.i = 0xff;
+  x = y;
+  return (x.b.i == 0xff);
+}

Added: cfe/trunk/test/CodeGen/2007-05-16-EmptyStruct.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-05-16-EmptyStruct.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-05-16-EmptyStruct.c (added)
+++ cfe/trunk/test/CodeGen/2007-05-16-EmptyStruct.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,5 @@
+// PR 1417
+// RUN: %clang_cc1   %s -emit-llvm -o - | FileCheck %s
+
+// CHECK: global %struct.anon* null
+struct { } *X;

Added: cfe/trunk/test/CodeGen/2007-05-29-UnionCopy.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-05-29-UnionCopy.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-05-29-UnionCopy.c (added)
+++ cfe/trunk/test/CodeGen/2007-05-29-UnionCopy.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -emit-llvm -o - %s | grep memcpy
+// PR1421
+
+struct A {
+  char c;
+  int i;
+};
+
+struct B {
+  int c;
+  unsigned char x;
+};
+
+union U { struct A a; struct B b; };
+
+void check(union U *u, union U *v) {
+  *u = *v;
+}

Added: cfe/trunk/test/CodeGen/2007-06-15-AnnotateAttribute.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-06-15-AnnotateAttribute.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-06-15-AnnotateAttribute.c (added)
+++ cfe/trunk/test/CodeGen/2007-06-15-AnnotateAttribute.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - | grep llvm.global.annotations
+// RUN: %clang_cc1 -emit-llvm %s -o - | grep llvm.var.annotation | count 3
+
+// XFAIL: *
+#include <stdio.h>
+
+/* Global variable with attribute */
+int X __attribute__((annotate("GlobalValAnnotation")));
+
+/* Function with attribute */
+int foo(int y) __attribute__((annotate("GlobalValAnnotation")))
+               __attribute__((noinline));
+
+int foo(int y __attribute__((annotate("LocalValAnnotation")))) {
+  int x __attribute__((annotate("LocalValAnnotation")));
+  x = 34;
+  return y + x;
+}
+
+int main() {
+  static int a __attribute__((annotate("GlobalValAnnotation")));
+  a = foo(2);
+  printf("hello world%d\n", a);
+  return 0;
+}

Added: cfe/trunk/test/CodeGen/2007-06-18-SextAttrAggregate.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-06-18-SextAttrAggregate.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-06-18-SextAttrAggregate.c (added)
+++ cfe/trunk/test/CodeGen/2007-06-18-SextAttrAggregate.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 %s -o - -emit-llvm | FileCheck %s
+// PR1513
+
+struct s{
+long a;
+long b;
+};
+
+void f(struct s a, char *b, signed char C) {
+  // CHECK: i8 signext
+
+}

Added: cfe/trunk/test/CodeGen/2007-07-29-RestrictPtrArg.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-07-29-RestrictPtrArg.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-07-29-RestrictPtrArg.c (added)
+++ cfe/trunk/test/CodeGen/2007-07-29-RestrictPtrArg.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - | grep noalias
+
+void foo(int * __restrict myptr1, int * myptr2) {
+  myptr1[0] = 0;
+  myptr2[0] = 0;
+}

Added: cfe/trunk/test/CodeGen/2007-08-01-LoadStoreAlign.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-08-01-LoadStoreAlign.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-08-01-LoadStoreAlign.c (added)
+++ cfe/trunk/test/CodeGen/2007-08-01-LoadStoreAlign.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
+
+struct p {
+  char a;
+  int b;
+} __attribute__ ((packed));
+
+struct p t = { 1, 10 };
+struct p u;
+
+int main () {
+  // CHECK: align 1
+  // CHECK: align 1
+  int tmp = t.b;
+  u.b = tmp;
+  return tmp;
+
+}

Added: cfe/trunk/test/CodeGen/2007-08-21-ComplexCst.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-08-21-ComplexCst.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-08-21-ComplexCst.c (added)
+++ cfe/trunk/test/CodeGen/2007-08-21-ComplexCst.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,3 @@
+// RUN: %clang_cc1 -O2 -emit-llvm %s -o /dev/null
+void f(_Complex float z);
+void g() { f(1.0i); }

Added: cfe/trunk/test/CodeGen/2007-08-22-CTTZ.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-08-22-CTTZ.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-08-22-CTTZ.c (added)
+++ cfe/trunk/test/CodeGen/2007-08-22-CTTZ.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
+
+int bork(unsigned long long x) {
+  // CHECK: llvm.cttz.i64
+  // CHECK: llvm.cttz.i64
+  // CHECK-NOT: lshr
+  return __builtin_ctzll(x);
+}

Added: cfe/trunk/test/CodeGen/2007-09-05-ConstCtor.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-09-05-ConstCtor.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-09-05-ConstCtor.c (added)
+++ cfe/trunk/test/CodeGen/2007-09-05-ConstCtor.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1  -Os -emit-llvm %s -o /dev/null
+// PR1641
+
+struct A {
+  unsigned long l;
+};
+
+void bar(struct A *a);
+
+void bork() {
+  const unsigned long vcgt = 1234;
+  struct A a = { vcgt };
+  bar(&a);
+}

Added: cfe/trunk/test/CodeGen/2007-09-14-NegatePointer.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-09-14-NegatePointer.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-09-14-NegatePointer.c (added)
+++ cfe/trunk/test/CodeGen/2007-09-14-NegatePointer.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - 
+// PR1662
+
+int foo(unsigned char *test) {
+  return 0U - (unsigned int )test;
+}
+

Added: cfe/trunk/test/CodeGen/2007-09-26-Alignment.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-09-26-Alignment.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-09-26-Alignment.c (added)
+++ cfe/trunk/test/CodeGen/2007-09-26-Alignment.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
+extern p(int *);
+int q(void) {
+  // CHECK: alloca i32, align 16
+  int x __attribute__ ((aligned (16)));
+  p(&x);
+  return x;
+}

Added: cfe/trunk/test/CodeGen/2007-09-28-PackedUnionMember.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-09-28-PackedUnionMember.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-09-28-PackedUnionMember.c (added)
+++ cfe/trunk/test/CodeGen/2007-09-28-PackedUnionMember.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,38 @@
+// RUN: %clang_cc1 %s -emit-llvm -o -
+
+#pragma pack(push, 2)
+struct H {
+  unsigned long f1;
+  unsigned long f2;
+  union {
+    struct opaque1 *f3;
+    struct opaque2 *f4;
+    struct {
+      struct opaque3 *f5;
+      unsigned short  f6;
+    } f7;
+  } f8;
+};
+#pragma pack(pop)
+
+struct E {
+  unsigned long f1;
+  unsigned long f2;
+};
+
+typedef long (*FuncPtr) ();
+
+extern long bork(FuncPtr handler, const struct E *list);
+
+static long hndlr()
+{
+  struct H cmd = { 4, 412 };
+  return 0;
+}
+void foo(void *inWindow) {
+  static const struct E events[] = {
+    { 123124, 1 }
+  };
+  bork(hndlr, events);
+}
+

Added: cfe/trunk/test/CodeGen/2007-10-02-VolatileArray.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-10-02-VolatileArray.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-10-02-VolatileArray.c (added)
+++ cfe/trunk/test/CodeGen/2007-10-02-VolatileArray.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - | grep volatile
+// PR1647
+
+void foo(volatile int *p)
+{
+p[0] = 0;
+}

Added: cfe/trunk/test/CodeGen/2007-10-15-VoidPtr.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-10-15-VoidPtr.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-10-15-VoidPtr.c (added)
+++ cfe/trunk/test/CodeGen/2007-10-15-VoidPtr.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,4 @@
+// RUN: %clang_cc1 -emit-llvm %s -o /dev/null
+void bork(void **data) {
+  (*(unsigned short *) (&(data[37])[927]) = 0);
+}

Added: cfe/trunk/test/CodeGen/2007-10-30-Volatile.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-10-30-Volatile.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-10-30-Volatile.c (added)
+++ cfe/trunk/test/CodeGen/2007-10-30-Volatile.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -emit-llvm %s -o /dev/null -Wall -Werror
+void bork() {
+  char * volatile p = 0;
+  volatile int cc = 0;
+  p += cc;
+}

Added: cfe/trunk/test/CodeGen/2007-11-07-AlignedMemcpy.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-11-07-AlignedMemcpy.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-11-07-AlignedMemcpy.c (added)
+++ cfe/trunk/test/CodeGen/2007-11-07-AlignedMemcpy.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,4 @@
+// RUN: %clang_cc1 -emit-llvm %s -o /dev/null
+void bork() {
+  int Qux[33] = {0};
+}

Added: cfe/trunk/test/CodeGen/2007-11-07-CopyAggregateAlign.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-11-07-CopyAggregateAlign.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-11-07-CopyAggregateAlign.c (added)
+++ cfe/trunk/test/CodeGen/2007-11-07-CopyAggregateAlign.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
+struct A { char s, t, u, v; short a; };
+// CHECK: %a = alloca %struct.A, align 2
+// CHECK: %b = alloca %struct.A, align 2
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp, i8* %tmp1, i64 6, i32 2, i1 false)
+
+void q() { struct A a, b; a = b; }

Added: cfe/trunk/test/CodeGen/2007-11-07-ZeroAggregateAlign.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-11-07-ZeroAggregateAlign.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-11-07-ZeroAggregateAlign.c (added)
+++ cfe/trunk/test/CodeGen/2007-11-07-ZeroAggregateAlign.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
+struct A { short s; short t; int i; };
+// CHECK: %a = alloca %struct.A, align 4
+// CHECK: call void @llvm.memset.p0i8.i64(i8* %tmp, i8 0, i64 8, i32 4, i1 false)
+void q() { struct A a = {0}; }

Added: cfe/trunk/test/CodeGen/2007-11-28-GlobalInitializer.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-11-28-GlobalInitializer.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-11-28-GlobalInitializer.c (added)
+++ cfe/trunk/test/CodeGen/2007-11-28-GlobalInitializer.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - 
+// PR1744
+typedef struct foo { int x; char *p; } FOO;
+extern FOO yy[];
+
+int *y = &((yy + 1)->x);
+void *z = &((yy + 1)->x);
+

Added: cfe/trunk/test/CodeGen/2007-12-16-AsmNoUnwind.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-12-16-AsmNoUnwind.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2007-12-16-AsmNoUnwind.c (added)
+++ cfe/trunk/test/CodeGen/2007-12-16-AsmNoUnwind.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,3 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - | grep nounwind
+
+void bar() { asm (""); }

Added: cfe/trunk/test/CodeGen/2008-01-07-UnusualIntSize.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2008-01-07-UnusualIntSize.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2008-01-07-UnusualIntSize.c (added)
+++ cfe/trunk/test/CodeGen/2008-01-07-UnusualIntSize.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
+// PR1721
+
+struct s {
+  unsigned long long u33: 33;
+} a, b;
+
+// This should have %0 and %1 truncated to 33 bits before any operation.
+// This can be done using i33 or an explicit and.
+_Bool test(void) {
+  // CHECK: and i64 %0, 8589934591
+  // CHECK: and i64 %1, 8589934591
+  return a.u33 + b.u33 != 0;
+}

Added: cfe/trunk/test/CodeGen/2008-01-11-ChainConsistency.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2008-01-11-ChainConsistency.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2008-01-11-ChainConsistency.c (added)
+++ cfe/trunk/test/CodeGen/2008-01-11-ChainConsistency.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,3 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - -fnested-functions | not grep nest
+
+void n1(void) { void a(void) { a(); } a(); }

Added: cfe/trunk/test/CodeGen/2008-01-21-PackedBitFields.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2008-01-21-PackedBitFields.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2008-01-21-PackedBitFields.c (added)
+++ cfe/trunk/test/CodeGen/2008-01-21-PackedBitFields.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 %s -emit-llvm -o -
+
+typedef double Al1Double __attribute__((aligned(1)));
+struct x { int a:23; Al1Double v; };
+struct x X = { 5, 3.0 };
+double foo() { return X.v; }
+

Added: cfe/trunk/test/CodeGen/2008-01-21-PackedStructField.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2008-01-21-PackedStructField.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2008-01-21-PackedStructField.c (added)
+++ cfe/trunk/test/CodeGen/2008-01-21-PackedStructField.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 %s -emit-llvm -o -
+
+struct X { long double b; unsigned char c; double __attribute__((packed)) d; };
+struct X x = { 3.0L, 5, 3.0 };
+
+
+struct S2504 {
+  int e:17;
+    __attribute__((packed)) unsigned long long int f; 
+} ;
+int fails;
+ extern struct S2504 s2504; 
+void check2504va (int z) { 
+  struct S2504 arg, *p;
+  long long int i = 0; 
+  arg.f = i;
+}
+

Added: cfe/trunk/test/CodeGen/2008-01-24-StructAlignAndBitFields.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2008-01-24-StructAlignAndBitFields.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2008-01-24-StructAlignAndBitFields.c (added)
+++ cfe/trunk/test/CodeGen/2008-01-24-StructAlignAndBitFields.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,4 @@
+// RUN: %clang_cc1 %s -emit-llvm -o -
+
+struct U { char a; short b; int c:25; char d; } u;
+

Added: cfe/trunk/test/CodeGen/2008-01-25-ByValReadNone.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2008-01-25-ByValReadNone.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2008-01-25-ByValReadNone.c (added)
+++ cfe/trunk/test/CodeGen/2008-01-25-ByValReadNone.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -O3 -emit-llvm -o - %s | not grep readonly
+// RUN: %clang_cc1 -O3 -emit-llvm -o - %s | not grep readnone
+
+
+// The struct being passed byval means that we cannot mark the
+// function readnone.  Readnone would allow stores to the arg to
+// be deleted in the caller.  We also don't allow readonly since
+// the callee might write to the byval parameter.  The inliner
+// would have to assume the worse and introduce an explicit
+// temporary when inlining such a function, which is costly for
+// the common case in which the byval argument is not written.
+struct S { int A[1000]; };
+int __attribute__ ((const)) f(struct S x) { x.A[1] = 0; return x.A[0]; }
+int g(struct S x) __attribute__ ((pure));
+int h(struct S x) { return g(x); }

Added: cfe/trunk/test/CodeGen/2008-01-25-ZeroSizedAggregate.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2008-01-25-ZeroSizedAggregate.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2008-01-25-ZeroSizedAggregate.c (added)
+++ cfe/trunk/test/CodeGen/2008-01-25-ZeroSizedAggregate.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,39 @@
+// RUN: %clang_cc1 %s -emit-llvm -o -
+
+// Aggregates of size zero should be dropped from argument list.
+typedef long int Tlong;
+struct S2411 {
+  __attribute__((aligned)) Tlong:0;
+};
+
+extern struct S2411 a2411[5];
+extern void checkx2411(struct S2411);
+void test2411(void) {
+  checkx2411(a2411[0]);
+}
+
+// Proper handling of zero sized fields during type conversion.
+typedef unsigned long long int Tal2ullong __attribute__((aligned(2)));
+struct S2525 {
+ Tal2ullong: 0;
+ struct {
+ } e;
+};
+struct S2525 s2525;
+
+struct {
+  signed char f;
+  char :0;
+  struct{}h;
+  char * i[5];
+} data; 
+
+// Taking address of a zero sized field.
+struct Z {};
+struct Y {
+  int i;
+  struct Z z;
+};
+void *f(struct Y *y) {
+  return &y->z;
+}

Added: cfe/trunk/test/CodeGen/2008-01-28-PragmaMark.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2008-01-28-PragmaMark.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2008-01-28-PragmaMark.c (added)
+++ cfe/trunk/test/CodeGen/2008-01-28-PragmaMark.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -Werror -emit-llvm %s -o /dev/null
+#pragma mark LLVM's world
+#ifdef DO_ERROR
+#error LLVM's world
+#endif
+int i;

Added: cfe/trunk/test/CodeGen/2008-01-28-UnionSize.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2008-01-28-UnionSize.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2008-01-28-UnionSize.c (added)
+++ cfe/trunk/test/CodeGen/2008-01-28-UnionSize.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,24 @@
+// RUN: %clang_cc1 %s -emit-llvm -o -
+// PR 1861
+
+typedef unsigned char __u8;
+typedef unsigned int __u32;
+typedef unsigned short u16;
+typedef __u32 __le32;
+struct bcm43xx_plcp_hdr6 {
+  union {
+    __le32 data;
+    __u8 raw[6];
+  }
+    __attribute__((__packed__));
+}
+  __attribute__((__packed__));
+struct bcm43xx_txhdr {
+  union {
+    struct {
+      struct bcm43xx_plcp_hdr6 plcp;
+    };
+  };
+}
+  __attribute__((__packed__));
+static void bcm43xx_generate_rts(struct bcm43xx_txhdr *txhdr ) { }

Added: cfe/trunk/test/CodeGen/2008-03-03-CtorAttrType.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2008-03-03-CtorAttrType.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2008-03-03-CtorAttrType.c (added)
+++ cfe/trunk/test/CodeGen/2008-03-03-CtorAttrType.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - | grep llvm.global_ctors
+int __attribute__((constructor)) foo(void) {
+  return 0;
+}
+void __attribute__((constructor)) bar(void) {}
+

Added: cfe/trunk/test/CodeGen/2008-03-05-syncPtr.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2008-03-05-syncPtr.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2008-03-05-syncPtr.c (added)
+++ cfe/trunk/test/CodeGen/2008-03-05-syncPtr.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,27 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - | grep llvm.atomic
+// XFAIL: sparc-sun-solaris2|arm
+// Feature currently implemented only for x86, alpha, powerpc.
+
+int* foo(int** a, int* b, int* c) {
+return __sync_val_compare_and_swap (a, b, c);
+}
+
+int foo2(int** a, int* b, int* c) {
+return __sync_bool_compare_and_swap (a, b, c);
+}
+
+int* foo3(int** a, int b) {
+  return __sync_fetch_and_add (a, b);
+}
+
+int* foo4(int** a, int b) {
+  return __sync_fetch_and_sub (a, b);
+}
+
+int* foo5(int** a, int* b) {
+  return __sync_lock_test_and_set (a, b);
+}
+
+int* foo6(int** a, int*** b) {
+  return __sync_lock_test_and_set (a, b);
+}

Added: cfe/trunk/test/CodeGen/2008-03-24-BitField-And-Alloca.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2008-03-24-BitField-And-Alloca.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2008-03-24-BitField-And-Alloca.c (added)
+++ cfe/trunk/test/CodeGen/2008-03-24-BitField-And-Alloca.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,89 @@
+// RUN: %clang_cc1 -O2 -emit-llvm %s -o - | not grep alloca
+// RUN: %clang_cc1 -m32 -O2 -emit-llvm %s -o - | not grep {store }
+
+enum {
+ PP_C,
+ PP_D,
+ PP_R,
+ PP_2D,
+ PP_1D,
+ PP_SR,
+ PP_S2D,
+ PP_S1D,
+ PP_SC
+};
+
+enum {
+ G_VP,
+ G_FP,
+ G_VS,
+ G_GS,
+ G_FS
+};
+
+enum {
+ G_NONE,
+ G_B,
+ G_R
+};
+
+typedef union _Key {
+ struct {
+  unsigned int count : 2;
+  unsigned int Aconst : 1;
+  unsigned int Bconst : 1;
+  unsigned int Cconst : 1;
+  unsigned int Xused : 1;
+  unsigned int Yused : 1;
+  unsigned int Zused : 1;
+  unsigned int Wused : 1;
+  unsigned int ttype : 3;
+  unsigned int scalar : 1;
+  unsigned int AType : 4;
+  unsigned int BType : 4;
+  unsigned int CType : 4;
+  unsigned int RType : 4;
+  unsigned int Size : 2;
+  unsigned int prec : 1;
+
+  unsigned int ASize : 2;
+  unsigned int BSize : 2;
+  unsigned int CSize : 2;
+  unsigned int tTex : 4;
+  unsigned int proj : 1;
+  unsigned int lod : 2;
+  unsigned int dvts : 1;
+  unsigned int uipad : 18;
+ } key_io;
+ struct {
+  unsigned int key0;
+  unsigned int key1;
+ } key;
+ unsigned long long lkey;
+} Key;
+
+static void foo(const Key iospec, int* ret)
+{
+  *ret=0;
+ if(((iospec.key_io.lod == G_B) &&
+  (iospec.key_io.ttype != G_VS) &&
+  (iospec.key_io.ttype != G_GS) &&
+  (iospec.key_io.ttype != G_FS)) ||
+
+  (((iospec.key_io.tTex == PP_C) ||
+    (iospec.key_io.tTex == PP_SC)) &&
+   ((iospec.key_io.tTex == PP_SR) ||
+    (iospec.key_io.tTex == PP_S2D) ||
+    (iospec.key_io.tTex == PP_S1D) ||
+    (iospec.key_io.tTex == PP_SC))))
+  *ret=1;
+}
+
+
+extern int bar(unsigned long long key_token2)
+{
+ int ret;
+ __attribute__ ((unused)) Key iospec = (Key) key_token2;
+ foo(iospec, &ret);
+ return ret;
+}

Added: cfe/trunk/test/CodeGen/2008-03-26-PackedBitFields.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2008-03-26-PackedBitFields.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2008-03-26-PackedBitFields.c (added)
+++ cfe/trunk/test/CodeGen/2008-03-26-PackedBitFields.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 %s -emit-llvm -o -
+
+
+struct S1757 { 
+  long double c;
+  long int __attribute__((packed)) e:28;
+} x;

Added: cfe/trunk/test/CodeGen/2008-04-08-NoExceptions.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2008-04-08-NoExceptions.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2008-04-08-NoExceptions.c (added)
+++ cfe/trunk/test/CodeGen/2008-04-08-NoExceptions.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
+
+void f(void);
+void g(void) {
+  // CHECK: define void @g() nounwind
+  // CHECK-NOT: call void @f() nounwind
+  f();
+}
+
+// CHECK-NOT: declare void @f() nounwind

Added: cfe/trunk/test/CodeGen/2008-05-06-CFECrash.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2008-05-06-CFECrash.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2008-05-06-CFECrash.c (added)
+++ cfe/trunk/test/CodeGen/2008-05-06-CFECrash.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,4 @@
+// RUN: %clang_cc1 -emit-llvm -O2 %s -o /dev/null
+// PR2292.
+__inline__ __attribute__ ((__pure__)) int g (void) {}
+void f (int k) { k = g (); }

Added: cfe/trunk/test/CodeGen/2008-05-12-TempUsedBeforeDef.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2008-05-12-TempUsedBeforeDef.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2008-05-12-TempUsedBeforeDef.c (added)
+++ cfe/trunk/test/CodeGen/2008-05-12-TempUsedBeforeDef.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -w -emit-llvm -o /dev/null %s
+// PR2264.
+unsigned foo = 8L;
+unsigned bar = 0L;
+volatile unsigned char baz = 6L;
+int test() {
+  char qux = 1L;
+  for (; baz >= -29; baz--)
+    bork(bar && foo, qux);
+}

Added: cfe/trunk/test/CodeGen/2008-05-19-AlwaysInline.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2008-05-19-AlwaysInline.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2008-05-19-AlwaysInline.c (added)
+++ cfe/trunk/test/CodeGen/2008-05-19-AlwaysInline.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 %s -emit-llvm -fno-unit-at-a-time -O0 -o - | not grep sabrina
+// RUN: %clang_cc1 %s -emit-llvm -funit-at-a-time -O0 -o - | not grep sabrina
+
+static inline int sabrina (void) __attribute__((always_inline));
+static inline int sabrina (void)
+{
+  return 13;
+}
+int bar (void)
+{
+  return sabrina () + 68;
+}

Added: cfe/trunk/test/CodeGen/2008-08-07-AlignPadding1.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2008-08-07-AlignPadding1.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2008-08-07-AlignPadding1.c (added)
+++ cfe/trunk/test/CodeGen/2008-08-07-AlignPadding1.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,32 @@
+/* RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
+
+The FE must generate padding here both at the end of each PyG_Head and
+between array elements.  Reduced from Python. */
+
+typedef union _gc_head {
+  struct {
+    union _gc_head *gc_next;
+    union _gc_head *gc_prev;
+    long gc_refs;
+  } gc;
+  int dummy __attribute__((aligned(16)));
+} PyGC_Head;
+
+struct gc_generation {
+  PyGC_Head head;
+  int threshold;
+  int count;
+};
+
+#define GEN_HEAD(n) (&generations[n].head)
+
+// The idea is that there are 6 undefs in this structure initializer to cover
+// the padding between elements.
+// CHECK: @generations = global [3 x %struct.gc_generation] [%struct.gc_generation { %union._gc_head { %struct.anon { %union._gc_head* getelementptr inbounds ([3 x %struct.gc_generation]* @generations, i32 0, i32 0, i32 0), %union._gc_head* getelementptr inbounds ([3 x %struct.gc_generation]* @generations, i32 0, i32 0, i32 0), i64 0 }, [8 x i8] undef }, i32 700, i32 0, [8 x i8] undef }, %struct.gc_generation { %union._gc_head { %struct.anon { %union._gc_head* bitcast (i8* getelementptr (i8* bitcast ([3 x %struct.gc_generation]* @generations to i8*), i64 48) to %union._gc_head*), %union._gc_head* bitcast (i8* getelementptr (i8* bitcast ([3 x %struct.gc_generation]* @generations to i8*), i64 48) to %union._gc_head*), i64 0 }, [8 x i8] undef }, i32 10, i32 0, [8 x i8] undef }, %struct.gc_generation { %union._gc_head { %struct.anon { %union._gc_head* bitcast (i8* getelementptr (i8* bitcast ([3 x %struct.gc_generation]* @generations to i8*), i64 96) to %union._gc_head*), %union.
 _gc_head* bitcast (i8* getelementptr (i8* bitcast ([3 x %struct.gc_generation]* @generations to i8*), i64 96) to %union._gc_head*), i64 0 }, [8 x i8] undef }, i32 10, i32 0, [8 x i8] undef }]
+/* linked lists of container objects */
+struct gc_generation generations[3] = {
+        /* PyGC_Head,                           threshold,      count */
+        {{{GEN_HEAD(0), GEN_HEAD(0), 0}},       700,            0},
+        {{{GEN_HEAD(1), GEN_HEAD(1), 0}},       10,             0},
+        {{{GEN_HEAD(2), GEN_HEAD(2), 0}},       10,             0},
+};

Added: cfe/trunk/test/CodeGen/2008-08-07-AlignPadding2.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2008-08-07-AlignPadding2.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2008-08-07-AlignPadding2.c (added)
+++ cfe/trunk/test/CodeGen/2008-08-07-AlignPadding2.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,18 @@
+/* RUN: %clang_cc1 %s -emit-llvm -o - -O0 | grep zeroinitializer | count 1
+
+The FE must not generate padding here between array elements.  PR 2533. */
+
+typedef struct {
+ const char *name;
+ int flags;
+ union {
+   int x;
+ } u;
+} OptionDef;
+
+const OptionDef options[] = {
+ /* main options */
+ { "a", 0, {3} },
+ { "b", 0, {4} },
+ { 0, },
+};

Added: cfe/trunk/test/CodeGen/2008-08-07-GEPIntToPtr.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2008-08-07-GEPIntToPtr.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2008-08-07-GEPIntToPtr.c (added)
+++ cfe/trunk/test/CodeGen/2008-08-07-GEPIntToPtr.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
+// PR2603
+
+struct A {
+  char num_fields;
+};
+
+struct B {
+  char a, b[1];
+};
+
+const struct A Foo = {
+  // CHECK: i8 1
+  (char *)(&( (struct B *)(16) )->b[0]) - (char *)(16)
+};

Added: cfe/trunk/test/CodeGen/2008-09-03-WeakAlias.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2008-09-03-WeakAlias.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2008-09-03-WeakAlias.c (added)
+++ cfe/trunk/test/CodeGen/2008-09-03-WeakAlias.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -emit-llvm -O1 -o - %s | grep icmp
+// PR1678
+extern void B (void);
+static __typeof(B) A __attribute__ ((__weakref__("B")));
+int active (void)
+{
+  static void *const p = __extension__ (void *) &A;
+  return p != 0;
+}

Added: cfe/trunk/test/CodeGen/2008-10-13-FrontendCrash.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2008-10-13-FrontendCrash.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2008-10-13-FrontendCrash.c (added)
+++ cfe/trunk/test/CodeGen/2008-10-13-FrontendCrash.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 %s -emit-llvm -o -
+// PR2797
+
+unsigned int
+func_48 (signed char p_49)
+{
+  signed char l_340;
+  func_44 (1&((1 ^ 1 == (lshift_u_s (1)) != (l_340 < 1)) & 1L));
+}

Added: cfe/trunk/test/CodeGen/2008-10-30-ZeroPlacement.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2008-10-30-ZeroPlacement.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2008-10-30-ZeroPlacement.c (added)
+++ cfe/trunk/test/CodeGen/2008-10-30-ZeroPlacement.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -emit-llvm %s -o -
+// PR2987
+struct S2045
+{
+  unsigned short int a;
+  union { } b;
+  union __attribute__ ((aligned (4))) { } c[0];
+};
+struct S2045 s2045;

Added: cfe/trunk/test/CodeGen/2008-11-02-WeakAlias.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2008-11-02-WeakAlias.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2008-11-02-WeakAlias.c (added)
+++ cfe/trunk/test/CodeGen/2008-11-02-WeakAlias.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -triple=i686-pc-linux-gnu -emit-llvm -o - %s | FileCheck %s
+// PR2691
+
+// CHECK: weak
+void init_IRQ(void) __attribute__((weak, alias("native_init_IRQ")));
+void native_init_IRQ(void) {}

Added: cfe/trunk/test/CodeGen/2008-11-08-InstCombineSelect.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2008-11-08-InstCombineSelect.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2008-11-08-InstCombineSelect.c (added)
+++ cfe/trunk/test/CodeGen/2008-11-08-InstCombineSelect.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 %s -emit-llvm -O2 -o -
+// PR3028
+
+int g_187;
+int g_204;
+int g_434;
+
+int func_89 (void)
+{
+  return 1;
+}
+
+void func_20 (int p_22)
+{
+  if (1 & p_22 | g_204 & (1 < g_187) - func_89 ())
+    g_434 = 1;
+}

Added: cfe/trunk/test/CodeGen/2009-01-05-BlockInlining.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2009-01-05-BlockInlining.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2009-01-05-BlockInlining.c (added)
+++ cfe/trunk/test/CodeGen/2009-01-05-BlockInlining.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,29 @@
+// RUN: %clang_cc1 %s -emit-llvm -fblocks -o - | FileCheck %s
+// rdar://5865221
+
+// These will be inlined by the optimizers provided the block descriptors
+// and block literals are internal constants.
+// CHECK: @__block_descriptor_tmp = internal constant
+// CHECK: @__block_literal_global = internal constant
+// CHECK: @__block_descriptor_tmp1 = internal constant
+// CHECK: @__block_literal_global2 = internal constant
+static int fun(int x) {
+	return x+1;
+}
+
+static int block(int x) {
+	return (^(int x){return x+1;})(x);
+}
+
+static void print(int result) {
+    printf("%d\n", result);
+}
+
+int main (int argc, const char * argv[]) {
+    int	x = argc-1;
+    print(fun(x));
+    print(block(x));
+    int	(^block_inline)(int) = ^(int x){return x+1;};
+    print(block_inline(x));
+    return 0;
+}

Added: cfe/trunk/test/CodeGen/2009-01-21-InvalidIterator.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2009-01-21-InvalidIterator.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2009-01-21-InvalidIterator.c (added)
+++ cfe/trunk/test/CodeGen/2009-01-21-InvalidIterator.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,74 @@
+// RUN: %clang_cc1 %s -emit-llvm -g -o /dev/null
+
+typedef long unsigned int size_t;
+typedef unsigned short int uint16_t;
+typedef unsigned int uint32_t;
+typedef unsigned long int uint64_t;
+typedef uint16_t Elf64_Half;
+typedef uint32_t Elf64_Word;
+typedef uint64_t Elf64_Xword;
+typedef uint64_t Elf64_Addr;
+typedef uint64_t Elf64_Off;
+typedef struct
+{
+  Elf64_Word p_type;
+  Elf64_Off p_offset;
+  Elf64_Addr p_vaddr;
+  Elf64_Xword p_align;
+}
+Elf64_Phdr;
+struct dl_phdr_info
+{
+  const char *dlpi_name;
+  const Elf64_Phdr *dlpi_phdr;
+  Elf64_Half dlpi_phnum;
+  unsigned long long int dlpi_adds;
+};
+typedef unsigned _Unwind_Ptr;
+struct object
+{
+  union
+  {
+    const struct dwarf_fde *single;
+    struct dwarf_fde **array;
+    struct fde_vector *sort;
+  }
+  u;
+  union
+  {
+    struct
+    {
+    }
+    b;
+  }
+  s;
+  struct object *next;
+};
+typedef int sword;
+typedef unsigned int uword;
+struct dwarf_fde
+{
+  uword length;
+  sword CIE_delta;
+  unsigned char pc_begin[];
+};
+typedef struct dwarf_fde fde;
+struct unw_eh_callback_data
+{
+  const fde *ret;
+  struct frame_hdr_cache_element *link;
+}
+frame_hdr_cache[8];
+
+_Unwind_Ptr
+base_from_cb_data (struct unw_eh_callback_data *data)
+{
+}
+
+void
+_Unwind_IteratePhdrCallback (struct dl_phdr_info *info, size_t size, void *ptr)
+{
+  const unsigned char *p;
+  const struct unw_eh_frame_hdr *hdr;
+  struct object ob;
+}

Added: cfe/trunk/test/CodeGen/2009-02-13-zerosize-union-field-ppc.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2009-02-13-zerosize-union-field-ppc.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2009-02-13-zerosize-union-field-ppc.c (added)
+++ cfe/trunk/test/CodeGen/2009-02-13-zerosize-union-field-ppc.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 %s -m32 -emit-llvm -o - | grep {i32 32} | count 3
+// XFAIL: *
+// XTARGET: powerpc
+//  Every printf has 'i32 0' for the GEP of the string; no point counting those.
+typedef unsigned int Foo __attribute__((aligned(32)));
+typedef union{Foo:0;}a;
+typedef union{int x; Foo:0;}b;
+extern int printf(const char*, ...);
+main() {
+  printf("%ld\n", sizeof(a));
+  printf("%ld\n", __alignof__(a));
+  printf("%ld\n", sizeof(b));
+  printf("%ld\n", __alignof__(b));
+}

Added: cfe/trunk/test/CodeGen/2009-02-13-zerosize-union-field.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2009-02-13-zerosize-union-field.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2009-02-13-zerosize-union-field.c (added)
+++ cfe/trunk/test/CodeGen/2009-02-13-zerosize-union-field.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 %s -triple i686-apple-darwin -emit-llvm -o - | FileCheck %s
+// Every printf has 'i32 0' for the GEP of the string; no point counting those.
+typedef unsigned int Foo __attribute__((aligned(32)));
+typedef union{Foo:0;}a;
+typedef union{int x; Foo:0;}b;
+extern int printf(const char*, ...);
+int main() {
+  // CHECK: getelementptr inbounds ([5 x i8]* @.str, i32 0, i32 0), i32 0
+  printf("%ld\n", sizeof(a));
+  // CHECK: getelementptr inbounds ([5 x i8]* @.str, i32 0, i32 0), i32 1
+  printf("%ld\n", __alignof__(a));
+  // CHECK: getelementptr inbounds ([5 x i8]* @.str, i32 0, i32 0), i32 4
+  printf("%ld\n", sizeof(b));
+  // CHECK: getelementptr inbounds ([5 x i8]* @.str, i32 0, i32 0), i32 4
+  printf("%ld\n", __alignof__(b));
+}

Added: cfe/trunk/test/CodeGen/2009-03-01-MallocNoAlias.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2009-03-01-MallocNoAlias.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2009-03-01-MallocNoAlias.c (added)
+++ cfe/trunk/test/CodeGen/2009-03-01-MallocNoAlias.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,3 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - | grep noalias
+
+void * __attribute__ ((malloc)) foo (void) { return 0; }

Added: cfe/trunk/test/CodeGen/2009-03-08-ZeroEltStructCrash.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2009-03-08-ZeroEltStructCrash.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2009-03-08-ZeroEltStructCrash.c (added)
+++ cfe/trunk/test/CodeGen/2009-03-08-ZeroEltStructCrash.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - 
+// PR3744
+struct Empty {};
+struct Union {
+ union {
+   int zero_arr[0];
+ } contents;
+};
+static inline void Foo(struct Union *u) {
+ int *array = u->contents.zero_arr;
+}
+static void Bar(struct Union *u) {
+ Foo(u);
+}

Added: cfe/trunk/test/CodeGen/2009-03-13-dbg.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2009-03-13-dbg.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2009-03-13-dbg.c (added)
+++ cfe/trunk/test/CodeGen/2009-03-13-dbg.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 %s -emit-llvm -g -o /dev/null
+// XTARGET: darwin,linux
+// XFAIL: *
+void foo() {}
+

Added: cfe/trunk/test/CodeGen/2009-04-28-UnionArrayCrash.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2009-04-28-UnionArrayCrash.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2009-04-28-UnionArrayCrash.c (added)
+++ cfe/trunk/test/CodeGen/2009-04-28-UnionArrayCrash.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - 
+// PR4082
+union U {
+  int I;
+  double F;
+};
+
+union U arr[] = { { .I = 4 }, { .F = 123.} };
+union U *P = &arr[0];
+
+

Added: cfe/trunk/test/CodeGen/2009-05-04-EnumInreg.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2009-05-04-EnumInreg.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2009-05-04-EnumInreg.c (added)
+++ cfe/trunk/test/CodeGen/2009-05-04-EnumInreg.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -emit-llvm -triple i686-apple-darwin -mregparm 3 %s -o - | FileCheck %s
+// PR3967
+
+enum kobject_action {
+        KOBJ_ADD,
+        KOBJ_REMOVE,
+        KOBJ_CHANGE,
+        KOBJ_MOVE,
+        KOBJ_ONLINE,
+        KOBJ_OFFLINE,
+        KOBJ_MAX
+};
+
+struct kobject;
+
+// CHECK: i32 inreg %action
+int kobject_uevent(struct kobject *kobj, enum kobject_action action) {}

Added: cfe/trunk/test/CodeGen/2009-06-14-HighlyAligned.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2009-06-14-HighlyAligned.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2009-06-14-HighlyAligned.c (added)
+++ cfe/trunk/test/CodeGen/2009-06-14-HighlyAligned.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 %s -emit-llvm -o /dev/null
+// PR4332
+
+static int highly_aligned __attribute__((aligned(4096)));
+
+int f() {
+	return highly_aligned;
+}

Added: cfe/trunk/test/CodeGen/2009-06-18-StaticInitTailPadPack.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2009-06-18-StaticInitTailPadPack.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2009-06-18-StaticInitTailPadPack.c (added)
+++ cfe/trunk/test/CodeGen/2009-06-18-StaticInitTailPadPack.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,26 @@
+// RUN: %clang_cc1 %s -emit-llvm -o -
+// rdar://6983634
+
+  typedef struct A *Foo;
+#pragma pack(push, 2)
+  struct Bar {
+    Foo             f1;
+    unsigned short  f2;
+    float           f3;
+  };
+  struct Baz {
+    struct Bar   f1;
+    struct Bar   f2;
+  };
+  struct Qux {
+    unsigned long   f1;
+    struct Baz             f2;
+  };
+extern const struct Qux Bork;
+const struct Qux Bork = {
+  0,
+  {
+    {0},
+    {0}
+  }
+};

Added: cfe/trunk/test/CodeGen/2009-07-14-VoidPtr.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2009-07-14-VoidPtr.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2009-07-14-VoidPtr.c (added)
+++ cfe/trunk/test/CodeGen/2009-07-14-VoidPtr.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -emit-llvm %s -o -
+// PR4556
+
+extern void foo;
+void *bar = &foo;
+

Added: cfe/trunk/test/CodeGen/2009-07-22-StructLayout.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2009-07-22-StructLayout.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2009-07-22-StructLayout.c (added)
+++ cfe/trunk/test/CodeGen/2009-07-22-StructLayout.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,34 @@
+// RUN: %clang_cc1 %s -triple i686-pc-linux-gnu -emit-llvm -o /dev/null
+// PR4590
+
+typedef unsigned char __u8;
+typedef unsigned int __le32;
+typedef unsigned int __u32;
+typedef unsigned short __le16;
+typedef unsigned short __u16;
+
+struct usb_cdc_ether_desc {
+ __u8 bLength;
+ __u8 bDescriptorType;
+ __u8 bDescriptorSubType;
+
+ __u8 iMACAddress;
+ __le32 bmEthernetStatistics;
+ __le16 wMaxSegmentSize;
+ __le16 wNumberMCFilters;
+ __u8 bNumberPowerFilters;
+} __attribute__ ((packed));
+
+
+static struct usb_cdc_ether_desc ecm_desc __attribute__ ((__section__(".init.data"))) = {
+ .bLength = sizeof ecm_desc,
+ .bDescriptorType = ((0x01 << 5) | 0x04),
+ .bDescriptorSubType = 0x0f,
+
+
+
+ .bmEthernetStatistics = (( __le32)(__u32)(0)),
+ .wMaxSegmentSize = (( __le16)(__u16)(1514)),
+ .wNumberMCFilters = (( __le16)(__u16)(0)),
+ .bNumberPowerFilters = 0,
+};

Added: cfe/trunk/test/CodeGen/2009-12-07-BitFieldAlignment.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2009-12-07-BitFieldAlignment.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2009-12-07-BitFieldAlignment.c (added)
+++ cfe/trunk/test/CodeGen/2009-12-07-BitFieldAlignment.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -triple i686-apple-darwin %s -emit-llvm -o - | FileCheck %s
+// Set alignment on bitfield accesses.
+
+struct S {
+  int a, b;
+  void *c;
+  unsigned d : 8;
+  unsigned e : 8;
+};
+
+void f0(struct S *a) {
+// CHECK: load {{.*}}, align 4
+// CHECK: store {{.*}}, align 4
+  a->e = 0;
+}

Added: cfe/trunk/test/CodeGen/2010-01-13-MemBarrier.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2010-01-13-MemBarrier.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2010-01-13-MemBarrier.c (added)
+++ cfe/trunk/test/CodeGen/2010-01-13-MemBarrier.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
+// XFAIL: sparc
+// rdar://7536390
+
+unsigned t(unsigned *ptr, unsigned val) {
+  // CHECK:      @t
+  // CHECK:      call void @llvm.memory.barrier
+  // CHECK-NEXT: call i32 @llvm.atomic.swap.i32
+  // CHECK-NEXT: call void @llvm.memory.barrier
+  return __sync_lock_test_and_set(ptr, val);
+}

Added: cfe/trunk/test/CodeGen/2010-01-14-FnType-DebugInfo.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2010-01-14-FnType-DebugInfo.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2010-01-14-FnType-DebugInfo.c (added)
+++ cfe/trunk/test/CodeGen/2010-01-14-FnType-DebugInfo.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,4 @@
+// RUN: %clang_cc1 %s -emit-llvm -g -o /dev/null
+typedef void (*sigcatch_t)( struct sigcontext *);
+sigcatch_t sigcatch[50] = {(sigcatch_t) 0};
+

Added: cfe/trunk/test/CodeGen/2010-01-18-Inlined-Debug.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2010-01-18-Inlined-Debug.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2010-01-18-Inlined-Debug.c (added)
+++ cfe/trunk/test/CodeGen/2010-01-18-Inlined-Debug.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,12 @@
+// PR: 6058
+// RUN: %clang_cc1 -g -emit-llvm %s  -O0 -o /dev/null
+
+static inline int foo(double) __attribute__ ((always_inline));
+static inline int foo(double __x) { return __x; }
+
+void bar(double x) {
+  foo(x);
+}
+
+
+

Added: cfe/trunk/test/CodeGen/2010-02-10-PointerName.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2010-02-10-PointerName.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2010-02-10-PointerName.c (added)
+++ cfe/trunk/test/CodeGen/2010-02-10-PointerName.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 %s -emit-llvm -g -o - | grep DW_TAG_pointer_type | grep -v char
+
+char i = 1;
+void foo() {
+  char *cp = &i;
+}
+

Added: cfe/trunk/test/CodeGen/2010-02-15-DbgStaticVar.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2010-02-15-DbgStaticVar.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2010-02-15-DbgStaticVar.c (added)
+++ cfe/trunk/test/CodeGen/2010-02-15-DbgStaticVar.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -g -emit-llvm %s -o - | grep "metadata ..b., metadata ..b., metadata ...,"
+// Test to check intentionally empty linkage name for a static variable.
+// Radar 7651244.
+static int foo(int a)
+{
+	static int b = 1;
+	return b+a;
+}
+
+int main() {
+	int j = foo(1);
+	return 0;
+}

Added: cfe/trunk/test/CodeGen/2010-03-10-arm-asmreg.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2010-03-10-arm-asmreg.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2010-03-10-arm-asmreg.c (added)
+++ cfe/trunk/test/CodeGen/2010-03-10-arm-asmreg.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 %s -emit-llvm -O0 -o - | FileCheck %s
+// pr6552
+
+// XFAIL: *
+// XTARGET: arm
+
+extern void bar(unsigned int ip);
+
+// CHECK: mov r0, r12
+void foo(void)
+{
+  register unsigned int ip __asm ("ip");
+  bar(ip);
+}
+

Added: cfe/trunk/test/CodeGen/2010-03-5-LexicalScope.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2010-03-5-LexicalScope.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2010-03-5-LexicalScope.c (added)
+++ cfe/trunk/test/CodeGen/2010-03-5-LexicalScope.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -emit-llvm -O0 -g %s -o - | grep DW_TAG_lexical_block | count 3
+int foo(int i) {
+	if (i) {
+		int j = 2;
+	}
+	else {
+		int j = 3;
+	}
+	return i;
+}

Added: cfe/trunk/test/CodeGen/2010-05-26-AsmSideEffect.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2010-05-26-AsmSideEffect.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2010-05-26-AsmSideEffect.c (added)
+++ cfe/trunk/test/CodeGen/2010-05-26-AsmSideEffect.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
+// Radar 8026855
+
+int test (void *src) {
+  register int w0 asm ("0");
+  // CHECK: call i32 asm "ldr $0, [$1]", "={ax},r,~{dirflag},~{fpsr},~{flags}"(i8* %tmp)
+  asm ("ldr %0, [%1]": "=r" (w0): "r" (src));
+  return w0;
+}

Added: cfe/trunk/test/CodeGen/2010-06-11-SaveExpr.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2010-06-11-SaveExpr.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2010-06-11-SaveExpr.c (added)
+++ cfe/trunk/test/CodeGen/2010-06-11-SaveExpr.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -emit-llvm %s -o -
+// Test case by Eric Postpischil!
+void foo(void)
+{
+  char a[1];
+  int t = 1;
+  ((char (*)[t]) a)[0][0] = 0;
+}

Added: cfe/trunk/test/CodeGen/2010-06-17-asmcrash.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2010-06-17-asmcrash.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2010-06-17-asmcrash.c (added)
+++ cfe/trunk/test/CodeGen/2010-06-17-asmcrash.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -emit-llvm -o - %s | llc -mtriple=x86_64-apple-darwin | FileCheck %s
+// XFAIL: *
+// XTARGET: x86,i386,i686
+
+typedef long long int64_t;
+typedef unsigned char uint8_t;
+typedef int64_t x86_reg;
+
+void avg_pixels8_mmx2(uint8_t *block, const uint8_t *pixels, int line_size, int h)
+{
+	__asm__ volatile("# %0 %1 %2 %3"
+     :"+g"(h), "+S"(pixels), "+D"(block)
+     :"r" ((x86_reg)line_size)         
+     :"%""rax", "memory");
+// CHECK: # %ecx %rsi %rdi %rdx
+ }

Added: cfe/trunk/test/CodeGen/2010-07-08-DeclDebugLineNo.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2010-07-08-DeclDebugLineNo.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2010-07-08-DeclDebugLineNo.c (added)
+++ cfe/trunk/test/CodeGen/2010-07-08-DeclDebugLineNo.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -emit-llvm -O0 -g %s -o - | FileCheck %s
+// Insure that dbg.declare lines for locals refer to correct line number records.
+// Radar 8152866.
+void foo() {
+  int l = 0;    // line #4: CHECK: {{call.*llvm.dbg.declare.*%l.*\!dbg }}[[variable_l:![0-9]+]]
+  int p = 0;    // line #5: CHECK: {{call.*llvm.dbg.declare.*%p.*\!dbg }}[[variable_p:![0-9]+]]
+}
+// Now match the line number records:
+// CHECK: {{^}}[[variable_l]]{{ = metadata ![{]i32 5,}}
+// CHECK: {{^}}[[variable_p]]{{ = metadata ![{]i32 6,}}

Added: cfe/trunk/test/CodeGen/2010-07-14-overconservative-align.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2010-07-14-overconservative-align.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2010-07-14-overconservative-align.c (added)
+++ cfe/trunk/test/CodeGen/2010-07-14-overconservative-align.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 %s -triple x86_64-apple-darwin -emit-llvm -o - | FileCheck %s
+// PR 5995
+struct s {
+  int word;
+  struct {
+    int filler __attribute__ ((aligned (8)));
+  };
+};
+
+void func (struct s *s)
+{
+  // CHECK: load %struct.s** %s.addr, align 8
+  s->word = 0;
+}

Added: cfe/trunk/test/CodeGen/2010-08-12-asm-aggr-arg.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2010-08-12-asm-aggr-arg.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2010-08-12-asm-aggr-arg.c (added)
+++ cfe/trunk/test/CodeGen/2010-08-12-asm-aggr-arg.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 %s -emit-llvm -O0 -o - | FileCheck %s
+// Radar 8288710: A small aggregate can be passed as an integer.  Make sure
+// we don't get an error with "input constraint with a matching output
+// constraint of incompatible type!" 
+
+struct wrapper {
+  int i;
+};
+
+// CHECK: xyz
+int test(int i) {
+  struct wrapper w;
+  w.i = i;
+  __asm__("xyz" : "=r" (w) : "0" (w));
+  return w.i;
+}

Added: cfe/trunk/test/CodeGen/2010-12-01-CommonGlobal.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2010-12-01-CommonGlobal.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2010-12-01-CommonGlobal.c (added)
+++ cfe/trunk/test/CodeGen/2010-12-01-CommonGlobal.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
+// Don't crash on a common-linkage constant global.
+extern const int kABSourceTypeProperty;
+int foo(void) {
+  return kABSourceTypeProperty;
+}
+const int kABSourceTypeProperty;

Added: cfe/trunk/test/CodeGen/2011-02-21-DATA-common.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2011-02-21-DATA-common.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2011-02-21-DATA-common.c (added)
+++ cfe/trunk/test/CodeGen/2011-02-21-DATA-common.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -emit-llvm %s -o /dev/null
+struct rtxc_snapshot {
+  int a, b, c, d;
+};
+__attribute__ ((section("__DATA, __common"))) static struct rtxc_snapshot rtxc_log_A[4];

Added: cfe/trunk/test/CodeGen/2011-03-02-UnionInitializer.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2011-03-02-UnionInitializer.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2011-03-02-UnionInitializer.c (added)
+++ cfe/trunk/test/CodeGen/2011-03-02-UnionInitializer.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,2 @@
+// RUN: %clang_cc1 -emit-llvm %s -o -
+union { int :3; double f; } u17_017 = {17.17};

Added: cfe/trunk/test/CodeGen/2011-03-08-ZeroFieldUnionInitializer.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2011-03-08-ZeroFieldUnionInitializer.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2011-03-08-ZeroFieldUnionInitializer.c (added)
+++ cfe/trunk/test/CodeGen/2011-03-08-ZeroFieldUnionInitializer.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -emit-llvm %s -o 0
+typedef struct {
+  union {
+    struct { } __attribute((packed));
+  };
+} fenv_t;
+const fenv_t _FE_DFL_ENV = {{{ 0, 0, 0, 0 }}};

Added: cfe/trunk/test/CodeGen/Atomics.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/Atomics.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/Atomics.c (added)
+++ cfe/trunk/test/CodeGen/Atomics.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,212 @@
+// Test frontend handling of __sync builtins.
+// Modified from a gcc testcase.
+// RUN: %clang_cc1 -emit-llvm %s -o - | grep atomic | count 172
+// RUN: %clang_cc1 -emit-llvm %s -o - | grep p0i8 | count 43
+// RUN: %clang_cc1 -emit-llvm %s -o - | grep p0i16 | count 43
+// RUN: %clang_cc1 -emit-llvm %s -o - | grep p0i32 | count 43
+// RUN: %clang_cc1 -emit-llvm %s -o - | grep volatile | count 8
+
+// Currently this is implemented only for Alpha, X86, PowerPC.
+// Add your target here if it doesn't work.
+// PPC32 does not translate the long long variants, so fails this test.
+// XFAIL: sparc,arm,powerpc
+
+signed char sc;
+unsigned char uc;
+signed short ss;
+unsigned short us;
+signed int si;
+unsigned int ui;
+signed long long sll;
+unsigned long long ull;
+
+void test_op_ignore (void)
+{
+  (void) __sync_fetch_and_add (&sc, 1);
+  (void) __sync_fetch_and_add (&uc, 1);
+  (void) __sync_fetch_and_add (&ss, 1);
+  (void) __sync_fetch_and_add (&us, 1);
+  (void) __sync_fetch_and_add (&si, 1);
+  (void) __sync_fetch_and_add (&ui, 1);
+  (void) __sync_fetch_and_add (&sll, 1);
+  (void) __sync_fetch_and_add (&ull, 1);
+
+  (void) __sync_fetch_and_sub (&sc, 1);
+  (void) __sync_fetch_and_sub (&uc, 1);
+  (void) __sync_fetch_and_sub (&ss, 1);
+  (void) __sync_fetch_and_sub (&us, 1);
+  (void) __sync_fetch_and_sub (&si, 1);
+  (void) __sync_fetch_and_sub (&ui, 1);
+  (void) __sync_fetch_and_sub (&sll, 1);
+  (void) __sync_fetch_and_sub (&ull, 1);
+
+  (void) __sync_fetch_and_or (&sc, 1);
+  (void) __sync_fetch_and_or (&uc, 1);
+  (void) __sync_fetch_and_or (&ss, 1);
+  (void) __sync_fetch_and_or (&us, 1);
+  (void) __sync_fetch_and_or (&si, 1);
+  (void) __sync_fetch_and_or (&ui, 1);
+  (void) __sync_fetch_and_or (&sll, 1);
+  (void) __sync_fetch_and_or (&ull, 1);
+
+  (void) __sync_fetch_and_xor (&sc, 1);
+  (void) __sync_fetch_and_xor (&uc, 1);
+  (void) __sync_fetch_and_xor (&ss, 1);
+  (void) __sync_fetch_and_xor (&us, 1);
+  (void) __sync_fetch_and_xor (&si, 1);
+  (void) __sync_fetch_and_xor (&ui, 1);
+  (void) __sync_fetch_and_xor (&sll, 1);
+  (void) __sync_fetch_and_xor (&ull, 1);
+
+  (void) __sync_fetch_and_and (&sc, 1);
+  (void) __sync_fetch_and_and (&uc, 1);
+  (void) __sync_fetch_and_and (&ss, 1);
+  (void) __sync_fetch_and_and (&us, 1);
+  (void) __sync_fetch_and_and (&si, 1);
+  (void) __sync_fetch_and_and (&ui, 1);
+  (void) __sync_fetch_and_and (&sll, 1);
+  (void) __sync_fetch_and_and (&ull, 1);
+
+}
+
+void test_fetch_and_op (void)
+{
+  sc = __sync_fetch_and_add (&sc, 11);
+  uc = __sync_fetch_and_add (&uc, 11);
+  ss = __sync_fetch_and_add (&ss, 11);
+  us = __sync_fetch_and_add (&us, 11);
+  si = __sync_fetch_and_add (&si, 11);
+  ui = __sync_fetch_and_add (&ui, 11);
+  sll = __sync_fetch_and_add (&sll, 11);
+  ull = __sync_fetch_and_add (&ull, 11);
+
+  sc = __sync_fetch_and_sub (&sc, 11);
+  uc = __sync_fetch_and_sub (&uc, 11);
+  ss = __sync_fetch_and_sub (&ss, 11);
+  us = __sync_fetch_and_sub (&us, 11);
+  si = __sync_fetch_and_sub (&si, 11);
+  ui = __sync_fetch_and_sub (&ui, 11);
+  sll = __sync_fetch_and_sub (&sll, 11);
+  ull = __sync_fetch_and_sub (&ull, 11);
+
+  sc = __sync_fetch_and_or (&sc, 11);
+  uc = __sync_fetch_and_or (&uc, 11);
+  ss = __sync_fetch_and_or (&ss, 11);
+  us = __sync_fetch_and_or (&us, 11);
+  si = __sync_fetch_and_or (&si, 11);
+  ui = __sync_fetch_and_or (&ui, 11);
+  sll = __sync_fetch_and_or (&sll, 11);
+  ull = __sync_fetch_and_or (&ull, 11);
+
+  sc = __sync_fetch_and_xor (&sc, 11);
+  uc = __sync_fetch_and_xor (&uc, 11);
+  ss = __sync_fetch_and_xor (&ss, 11);
+  us = __sync_fetch_and_xor (&us, 11);
+  si = __sync_fetch_and_xor (&si, 11);
+  ui = __sync_fetch_and_xor (&ui, 11);
+  sll = __sync_fetch_and_xor (&sll, 11);
+  ull = __sync_fetch_and_xor (&ull, 11);
+
+  sc = __sync_fetch_and_and (&sc, 11);
+  uc = __sync_fetch_and_and (&uc, 11);
+  ss = __sync_fetch_and_and (&ss, 11);
+  us = __sync_fetch_and_and (&us, 11);
+  si = __sync_fetch_and_and (&si, 11);
+  ui = __sync_fetch_and_and (&ui, 11);
+  sll = __sync_fetch_and_and (&sll, 11);
+  ull = __sync_fetch_and_and (&ull, 11);
+
+}
+
+void test_op_and_fetch (void)
+{
+  sc = __sync_add_and_fetch (&sc, uc);
+  uc = __sync_add_and_fetch (&uc, uc);
+  ss = __sync_add_and_fetch (&ss, uc);
+  us = __sync_add_and_fetch (&us, uc);
+  si = __sync_add_and_fetch (&si, uc);
+  ui = __sync_add_and_fetch (&ui, uc);
+  sll = __sync_add_and_fetch (&sll, uc);
+  ull = __sync_add_and_fetch (&ull, uc);
+
+  sc = __sync_sub_and_fetch (&sc, uc);
+  uc = __sync_sub_and_fetch (&uc, uc);
+  ss = __sync_sub_and_fetch (&ss, uc);
+  us = __sync_sub_and_fetch (&us, uc);
+  si = __sync_sub_and_fetch (&si, uc);
+  ui = __sync_sub_and_fetch (&ui, uc);
+  sll = __sync_sub_and_fetch (&sll, uc);
+  ull = __sync_sub_and_fetch (&ull, uc);
+
+  sc = __sync_or_and_fetch (&sc, uc);
+  uc = __sync_or_and_fetch (&uc, uc);
+  ss = __sync_or_and_fetch (&ss, uc);
+  us = __sync_or_and_fetch (&us, uc);
+  si = __sync_or_and_fetch (&si, uc);
+  ui = __sync_or_and_fetch (&ui, uc);
+  sll = __sync_or_and_fetch (&sll, uc);
+  ull = __sync_or_and_fetch (&ull, uc);
+
+  sc = __sync_xor_and_fetch (&sc, uc);
+  uc = __sync_xor_and_fetch (&uc, uc);
+  ss = __sync_xor_and_fetch (&ss, uc);
+  us = __sync_xor_and_fetch (&us, uc);
+  si = __sync_xor_and_fetch (&si, uc);
+  ui = __sync_xor_and_fetch (&ui, uc);
+  sll = __sync_xor_and_fetch (&sll, uc);
+  ull = __sync_xor_and_fetch (&ull, uc);
+
+  sc = __sync_and_and_fetch (&sc, uc);
+  uc = __sync_and_and_fetch (&uc, uc);
+  ss = __sync_and_and_fetch (&ss, uc);
+  us = __sync_and_and_fetch (&us, uc);
+  si = __sync_and_and_fetch (&si, uc);
+  ui = __sync_and_and_fetch (&ui, uc);
+  sll = __sync_and_and_fetch (&sll, uc);
+  ull = __sync_and_and_fetch (&ull, uc);
+
+}
+
+void test_compare_and_swap (void)
+{
+  sc = __sync_val_compare_and_swap (&sc, uc, sc);
+  uc = __sync_val_compare_and_swap (&uc, uc, sc);
+  ss = __sync_val_compare_and_swap (&ss, uc, sc);
+  us = __sync_val_compare_and_swap (&us, uc, sc);
+  si = __sync_val_compare_and_swap (&si, uc, sc);
+  ui = __sync_val_compare_and_swap (&ui, uc, sc);
+  sll = __sync_val_compare_and_swap (&sll, uc, sc);
+  ull = __sync_val_compare_and_swap (&ull, uc, sc);
+
+  ui = __sync_bool_compare_and_swap (&sc, uc, sc);
+  ui = __sync_bool_compare_and_swap (&uc, uc, sc);
+  ui = __sync_bool_compare_and_swap (&ss, uc, sc);
+  ui = __sync_bool_compare_and_swap (&us, uc, sc);
+  ui = __sync_bool_compare_and_swap (&si, uc, sc);
+  ui = __sync_bool_compare_and_swap (&ui, uc, sc);
+  ui = __sync_bool_compare_and_swap (&sll, uc, sc);
+  ui = __sync_bool_compare_and_swap (&ull, uc, sc);
+}
+
+void test_lock (void)
+{
+  sc = __sync_lock_test_and_set (&sc, 1);
+  uc = __sync_lock_test_and_set (&uc, 1);
+  ss = __sync_lock_test_and_set (&ss, 1);
+  us = __sync_lock_test_and_set (&us, 1);
+  si = __sync_lock_test_and_set (&si, 1);
+  ui = __sync_lock_test_and_set (&ui, 1);
+  sll = __sync_lock_test_and_set (&sll, 1);
+  ull = __sync_lock_test_and_set (&ull, 1);
+
+  __sync_synchronize ();
+
+  __sync_lock_release (&sc);
+  __sync_lock_release (&uc);
+  __sync_lock_release (&ss);
+  __sync_lock_release (&us);
+  __sync_lock_release (&si);
+  __sync_lock_release (&ui);
+  __sync_lock_release (&sll);
+  __sync_lock_release (&ull);
+}

Added: cfe/trunk/test/CodeGen/BasicInstrs.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/BasicInstrs.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/BasicInstrs.c (added)
+++ cfe/trunk/test/CodeGen/BasicInstrs.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,25 @@
+// This file can be used to see what a native C compiler is generating for a
+// variety of interesting operations.
+//
+// RUN: %clang_cc1 -emit-llvm %s -o -
+
+unsigned int udiv(unsigned int X, unsigned int Y) {
+  return X/Y;
+}
+int sdiv(int X, int Y) {
+  return X/Y;
+}
+unsigned int urem(unsigned int X, unsigned int Y) {
+  return X%Y;
+}
+int srem(int X, int Y) {
+  return X%Y;
+}
+
+_Bool setlt(int X, int Y) {
+  return X < Y;
+}
+
+_Bool setgt(int X, int Y) {
+  return X > Y;
+}

Added: cfe/trunk/test/CodeGen/always-inline.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/always-inline.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/always-inline.c (added)
+++ cfe/trunk/test/CodeGen/always-inline.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - | grep call | not grep foo
+
+void bar() {
+}
+
+inline void __attribute__((__always_inline__)) foo() {
+  bar();
+}
+
+void i_want_bar() {
+  foo();
+}

Added: cfe/trunk/test/CodeGen/arrayderef.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/arrayderef.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/arrayderef.c (added)
+++ cfe/trunk/test/CodeGen/arrayderef.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 %s -emit-llvm -O1 -o - | FileCheck %s
+// The load here was getting lost because this code was close
+// enough to the traditional (wrong) implementation of offsetof
+// to confuse the gcc FE.  8629268.
+
+struct foo {
+  int x;
+  int *y;
+};
+
+struct foo Foo[1];
+
+int * bar(unsigned int ix) {
+// CHECK: load
+  return &Foo->y[ix];
+}

Added: cfe/trunk/test/CodeGen/asm-reg-var-local.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/asm-reg-var-local.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/asm-reg-var-local.c (added)
+++ cfe/trunk/test/CodeGen/asm-reg-var-local.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,24 @@
+// RUN: %clang_cc1 %s -triple x86_64-apple-darwin -emit-llvm -o - | FileCheck %s
+// Exercise various use cases for local asm "register variables".
+
+int foo() {
+// CHECK: %a = alloca i32
+
+  register int a asm("rsi")=5;
+// CHECK: store i32 5, i32* %a
+
+  asm volatile("; %0 This asm defines rsi" : "=r"(a));
+// CHECK: %0 = call i32 asm sideeffect "; $0 This asm defines rsi", "={rsi},~{dirflag},~{fpsr},~{flags}"()
+// CHECK: store i32 %0, i32* %a
+
+  a = 42;
+// CHECK:  store i32 42, i32* %a
+
+  asm volatile("; %0 This asm uses rsi" : : "r"(a));
+// CHECK:  %tmp = load i32* %a
+// CHECK:  call void asm sideeffect "; $0 This asm uses rsi", "{rsi},~{dirflag},~{fpsr},~{flags}"(i32 %tmp)
+
+  return a;
+// CHECK:  %tmp1 = load i32* %a
+// CHECK:  ret i32 %tmp1
+}

Added: cfe/trunk/test/CodeGen/attribute_constructor.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/attribute_constructor.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/attribute_constructor.c (added)
+++ cfe/trunk/test/CodeGen/attribute_constructor.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - | grep llvm.global_ctors
+
+void foo() __attribute__((constructor));
+void foo() {
+  bar();
+}

Added: cfe/trunk/test/CodeGen/block-copy.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/block-copy.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/block-copy.c (added)
+++ cfe/trunk/test/CodeGen/block-copy.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,20 @@
+/* RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
+
+ This should compile into a memcpy from a global, not 128 stores. */
+
+
+
+void foo();
+
+float bar() {
+  float lookupTable[] = {-1,-1,-1,0, -1,-1,0,-1, -1,-1,0,1, -1,-1,1,0,
+			 -1,0,-1,-1, -1,0,-1,1, -1,0,1,-1, -1,0,1,1,
+			 -1,1,-1,0, -1,1,0,-1, -1,1,0,1, -1,1,1,0,
+			 0,-1,-1,-1, 0,-1,-1,1, 0,-1,1,-1, 0,-1,1,1,
+			 1,-1,-1,0, 1,-1,0,-1, 1,-1,0,1, 1,-1,1,0,
+			 1,0,-1,-1, 1,0,-1,1, 1,0,1,-1, 1,0,1,1,
+			 1,1,-1,0, 1,1,0,-1, 1,1,0,1, 1,1,1,0,
+			 0,1,-1,-1, 0,1,-1,1, 0,1,1,-1, 0,1,1,1};
+  // CHECK: memcpy
+  foo(lookupTable);
+}

Added: cfe/trunk/test/CodeGen/exact-div-expr.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/exact-div-expr.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/exact-div-expr.c (added)
+++ cfe/trunk/test/CodeGen/exact-div-expr.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - -O1 | grep ashr
+// RUN: %clang_cc1 -emit-llvm %s -o - -O1 | not grep sdiv
+
+long long test(int *A, int *B) {
+  return A-B;
+}

Added: cfe/trunk/test/CodeGen/extern-weak.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/extern-weak.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/extern-weak.c (added)
+++ cfe/trunk/test/CodeGen/extern-weak.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -O3 -emit-llvm -o - %s | grep extern_weak
+// RUN: %clang_cc1 -O3 -emit-llvm -o - %s | llc
+
+#if !defined(__linux__) && !defined(__FreeBSD__) && \
+    !defined(__OpenBSD__) && !defined(__CYGWIN__) && !defined(__DragonFly__)
+void foo() __attribute__((weak_import));
+#else
+void foo() __attribute__((weak));
+#endif
+
+void bar() { foo(); }
+

Added: cfe/trunk/test/CodeGen/func-aligned.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/func-aligned.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/func-aligned.c (added)
+++ cfe/trunk/test/CodeGen/func-aligned.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
+
+// rdar://7270273
+void foo() __attribute__((aligned (64)));
+void foo() {
+// CHECK: define void @foo() {{.*}} align 64
+}

Added: cfe/trunk/test/CodeGen/funccall.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/funccall.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/funccall.c (added)
+++ cfe/trunk/test/CodeGen/funccall.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,17 @@
+
+static int q;
+
+void foo() {
+  int t = q;
+  q = t + 1;
+}
+int main() {
+  q = 0;
+  foo();
+  q = q - 1;
+
+  return q;
+}
+
+// This is the source that corresponds to funccall.ll
+// RUN: echo foo

Added: cfe/trunk/test/CodeGen/hidden-visibility.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/hidden-visibility.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/hidden-visibility.c (added)
+++ cfe/trunk/test/CodeGen/hidden-visibility.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,4 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
+
+// CHECK: hidden global
+int X __attribute__ ((__visibility__ ("hidden"))) = 123;

Added: cfe/trunk/test/CodeGen/implicit-arg.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/implicit-arg.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/implicit-arg.c (added)
+++ cfe/trunk/test/CodeGen/implicit-arg.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 %s -emit-llvm -O0 -o -
+// RUN: %clang_cc1 %s -emit-llvm -O1 -o -
+// rdar://6518089
+
+static int bar();
+void foo() {
+  int a = bar();
+}
+int bar(unsigned a) {
+}

Added: cfe/trunk/test/CodeGen/libcalls-d.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/libcalls-d.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/libcalls-d.c (added)
+++ cfe/trunk/test/CodeGen/libcalls-d.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,16 @@
+// llvm-gcc -O1+ should run simplify libcalls, O0 shouldn't
+// and -fno-builtins shouldn't.
+// -fno-math-errno should emit an llvm intrinsic, -fmath-errno should not.
+// RUN: %clang_cc1 %s -emit-llvm -fno-math-errno -O0 -o - | grep {call.*exp2\\.f64}
+// RUN: %clang_cc1 %s -emit-llvm -fmath-errno -O0 -o - | grep {call.*exp2}
+// RUN: %clang_cc1 %s -emit-llvm -O1 -o - | grep {call.*ldexp}
+// RUN: %clang_cc1 %s -emit-llvm -O3 -fno-builtin -o - | grep {call.*exp2}
+
+// clang doesn't support this yet.
+// XFAIL: *
+
+double exp2(double);
+
+double t4(unsigned char x) {
+  return exp2(x);
+}

Added: cfe/trunk/test/CodeGen/libcalls-ld.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/libcalls-ld.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/libcalls-ld.c (added)
+++ cfe/trunk/test/CodeGen/libcalls-ld.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,19 @@
+// llvm-gcc -O1+ should run simplify libcalls, O0 shouldn't
+// and -fno-builtins shouldn't.
+// -fno-math-errno should emit an llvm intrinsic, -fmath-errno should not.
+// RUN: %clang_cc1 %s -emit-llvm -fno-math-errno -O0 -o - | grep {call.*exp2\\..*f}
+// RUN: %clang_cc1 %s -emit-llvm -fmath-errno -O0 -o - | grep {call.*exp2l}
+// RUN: %clang_cc1 %s -emit-llvm -O1 -o - | grep {call.*ldexp}
+// RUN: %clang_cc1 %s -emit-llvm -O3 -fno-builtin -o - | grep {call.*exp2l}
+
+// clang doesn't support this yet.
+// XFAIL: *
+
+// If this fails for you because your target doesn't support long double,
+// please xfail the test.
+
+long double exp2l(long double);
+
+long double t4(unsigned char x) {
+  return exp2l(x);
+}

Added: cfe/trunk/test/CodeGen/misaligned-param.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/misaligned-param.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/misaligned-param.c (added)
+++ cfe/trunk/test/CodeGen/misaligned-param.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 %s -triple i386-apple-darwin -emit-llvm -o - | FileCheck %s
+// Misaligned parameter must be memcpy'd to correctly aligned temporary.
+
+struct s { int x; long double y; };
+long double foo(struct s x, int i, struct s y) {
+// CHECK: foo
+// CHECK: %x = alloca %struct.s, align 16
+// CHECK: %y = alloca %struct.s, align 16
+// CHECK: memcpy
+// CHECK: memcpy
+// CHECK: bar
+  return bar(&x, &y);
+}

Added: cfe/trunk/test/CodeGen/pr2394.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/pr2394.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/pr2394.c (added)
+++ cfe/trunk/test/CodeGen/pr2394.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
+struct __attribute((packed)) x {int a : 24;};
+int a(struct x* g) {
+  // CHECK: load i16
+  // CHECK: load i8
+  return g->a;
+}

Added: cfe/trunk/test/CodeGen/pr3518.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/pr3518.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/pr3518.c (added)
+++ cfe/trunk/test/CodeGen/pr3518.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,29 @@
+// RUN: %clang_cc1 %s -emit-llvm -O0 -o - | FileCheck %s
+// PR 3518
+// Some of the objects were coming out as unintialized (external) before 3518
+// was fixed.  Internal names are different between llvm-gcc and clang so they
+// are not tested.
+
+extern void abort (void);
+
+// CHECK: @.compoundliteral = internal global %struct.A { i32 1, i32 2 }
+// CHECK: @.compoundliteral1 = internal global %struct.A { i32 3, i32 4 }
+// CHECK: @.compoundliteral2 = internal global %struct.B { %struct.A* @.compoundliteral, %struct.A* @.compoundliteral1 }
+// CHECK: @.compoundliteral3 = internal global %struct.A { i32 5, i32 6 }
+
+struct A { int i; int j; };
+struct B { struct A *a; struct A *b; };
+struct C { struct B *c; struct A *d; };
+struct C e = { &(struct B) { &(struct A) { 1, 2 }, &(struct A) { 3, 4 } }, &(struct A) { 5, 6 } };
+
+int
+main (void)
+{
+  if (e.c->a->i != 1 || e.c->a->j != 2)
+    abort ();
+  if (e.c->b->i != 3 || e.c->b->j != 4)
+    abort ();
+  if (e.d->i != 5 || e.d->j != 6)
+    abort ();
+  return 0;
+}

Added: cfe/trunk/test/CodeGen/pr4349.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/pr4349.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/pr4349.c (added)
+++ cfe/trunk/test/CodeGen/pr4349.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,38 @@
+// RUN: %clang_cc1 %s -emit-llvm -O0 -o - | FileCheck %s
+// PR 4349
+
+union reg
+{
+    unsigned char b[2][2];
+    unsigned short w[2];
+    unsigned int d;
+};
+struct cpu
+{
+    union reg pc;
+};
+extern struct cpu cpu;
+struct svar
+{
+    void *ptr;
+};
+// CHECK: @svars1 = global [1 x %struct.svar] [%struct.svar { i8* bitcast (%struct.cpu* @cpu to i8*) }]
+struct svar svars1[] =
+{
+    { &((cpu.pc).w[0]) }
+};
+// CHECK: @svars2 = global [1 x %struct.svar] [%struct.svar { i8* getelementptr (i8* bitcast (%struct.cpu* @cpu to i8*), i64 1) }]
+struct svar svars2[] =
+{
+    { &((cpu.pc).b[0][1]) }
+};
+// CHECK: @svars3 = global [1 x %struct.svar] [%struct.svar { i8* getelementptr (i8* bitcast (%struct.cpu* @cpu to i8*), i64 2) }]
+struct svar svars3[] =
+{
+    { &((cpu.pc).w[1]) }
+};
+// CHECK: @svars4 = global [1 x %struct.svar] [%struct.svar { i8* getelementptr (i8* bitcast (%struct.cpu* @cpu to i8*), i64 3) }]
+struct svar svars4[] =
+{
+    { &((cpu.pc).b[1][1]) }
+};

Added: cfe/trunk/test/CodeGen/pr5406.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/pr5406.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/pr5406.c (added)
+++ cfe/trunk/test/CodeGen/pr5406.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 %s -emit-llvm -O0 -o - | FileCheck %s
+// PR 5406
+
+// XFAIL: *
+// XTARGET: arm
+
+typedef struct { char x[3]; } A0;
+void foo (int i, ...);
+
+
+// CHECK: call void (i32, ...)* @foo(i32 1, i32 {{.*}}) nounwind
+int main (void)
+{
+  A0 a3;
+  a3.x[0] = 0;
+  a3.x[0] = 0;
+  a3.x[2] = 26;
+  foo (1,  a3 );
+  return 0;
+}

Added: cfe/trunk/test/CodeGen/redef-ext-inline.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/redef-ext-inline.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/redef-ext-inline.c (added)
+++ cfe/trunk/test/CodeGen/redef-ext-inline.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - -std=gnu89
+// rdar://7208839
+
+extern inline int f1 (void) {return 1;}
+int f3 (void) {return f1();}
+int f1 (void) {return 0;}

Added: cfe/trunk/test/CodeGen/sret.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/sret.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/sret.c (added)
+++ cfe/trunk/test/CodeGen/sret.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 %s -emit-llvm -O0 -o - | grep sret | count 5
+
+struct abc {
+ long a;
+ long b;
+ long c;
+};
+ 
+struct abc foo1(void);
+struct abc foo2();
+
+void bar() {
+  struct abc dummy1 = foo1();
+  struct abc dummy2 = foo2();
+}

Added: cfe/trunk/test/CodeGen/struct-matching-constraint.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/struct-matching-constraint.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/struct-matching-constraint.c (added)
+++ cfe/trunk/test/CodeGen/struct-matching-constraint.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -emit-llvm -march=armv7a %s 
+
+// XFAIL: *
+// XTARGET: arm
+
+typedef struct __simd128_uint16_t
+{
+  __neon_uint16x8_t val;
+} uint16x8_t;
+
+void b(uint16x8_t sat, uint16x8_t luma)
+{
+  __asm__("vmov.16 %1, %0   \n\t"
+                                           "vtrn.16 %0, %1   \n\t"
+   :"=w"(luma), "=w"(sat)
+   :"0"(luma)
+   );
+
+}

Added: cfe/trunk/test/CodeGen/unaligned-memcpy.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/unaligned-memcpy.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/unaligned-memcpy.c (added)
+++ cfe/trunk/test/CodeGen/unaligned-memcpy.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 %s -emit-llvm -o -
+
+void bork() {
+  char Qux[33] = {0};
+}

Added: cfe/trunk/test/CodeGen/union-align.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/union-align.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/union-align.c (added)
+++ cfe/trunk/test/CodeGen/union-align.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - | grep load | grep "4 x float" | not grep "align 4"
+// RUN: %clang_cc1 -emit-llvm %s -o - | grep load | grep "4 x float" | grep "align 16"
+// PR3432
+// rdar://6536377
+
+typedef float __m128 __attribute__ ((__vector_size__ (16)));
+
+typedef union
+{
+  int i[4];
+  float f[4];
+  __m128 v;
+} u_t;
+
+__m128 t(u_t *a) {
+  return a->v;
+}

Added: cfe/trunk/test/CodeGen/vla-2.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/vla-2.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/vla-2.c (added)
+++ cfe/trunk/test/CodeGen/vla-2.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -std=gnu99 %s -emit-llvm -o - | grep ".*alloca.*align 16"
+
+extern void bar(int[]);
+
+void foo(int a)
+{
+  int var[a] __attribute__((__aligned__(16)));
+  bar(var);
+  return;
+}

Added: cfe/trunk/test/CodeGen/vla-3.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/vla-3.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/vla-3.c (added)
+++ cfe/trunk/test/CodeGen/vla-3.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -std=gnu99 %s -emit-llvm -o - | grep ".*alloca.*align 16"
+
+void adr(char *);
+
+void vlaalign(int size)
+{
+    char __attribute__((aligned(16))) tmp[size+32];
+    char tmp2[size+16];
+
+    adr(tmp);
+}

Added: cfe/trunk/test/CodeGen/weak_constant.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/weak_constant.c?rev=136159&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/weak_constant.c (added)
+++ cfe/trunk/test/CodeGen/weak_constant.c Tue Jul 26 17:17:02 2011
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -w -emit-llvm %s -O1 -o - | FileCheck %s
+// Check for bug compatibility with gcc.
+
+const int x __attribute((weak)) = 123;
+
+int* f(void) {
+  return &x;
+}
+
+int g(void) {
+  // CHECK: ret i32 123
+  return *f();
+}





More information about the cfe-commits mailing list