]> granicus.if.org Git - clang/commitdiff
Re-applying 96173. Looks like finally I got the test case right.
authorSanjiv Gupta <sanjiv.gupta@microchip.com>
Tue, 16 Feb 2010 03:37:11 +0000 (03:37 +0000)
committerSanjiv Gupta <sanjiv.gupta@microchip.com>
Tue, 16 Feb 2010 03:37:11 +0000 (03:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96321 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Targets.cpp
test/Preprocessor/init.c

index b96e17d8924336e5c6c617a0f03e0b74b1579407..c1cd96e361edf8f5f871a7052b7bb9cc38ba1458 100644 (file)
@@ -1619,23 +1619,25 @@ namespace {
     virtual void getTargetDefines(const LangOptions &Opts,
                                 MacroBuilder &Builder) const {
       Builder.defineMacro("__pic16");
+      Builder.defineMacro("__PIC16");
       Builder.defineMacro("rom", "__attribute__((address_space(1)))");
       Builder.defineMacro("ram", "__attribute__((address_space(0)))");
-      Builder.defineMacro("_section(SectName)",
+      Builder.defineMacro("__section(SectName)",
              "__attribute__((section(SectName)))");
       Builder.defineMacro("near",
              "__attribute__((section(\"Address=NEAR\")))");
-      Builder.defineMacro("_address(Addr)",
+      Builder.defineMacro("__address(Addr)",
              "__attribute__((section(\"Address=\"#Addr)))");
-      Builder.defineMacro("_CONFIG(conf)", "asm(\"CONFIG \"#conf)");
-      Builder.defineMacro("_interrupt",
+      Builder.defineMacro("__config(conf)", "asm(\"CONFIG \"#conf)");
+      Builder.defineMacro("__idlocs(value)", "asm(\"__IDLOCS \"#value)");
+      Builder.defineMacro("interrupt",
              "__attribute__((section(\"interrupt=0x4\"))) \
              __attribute__((used))");
     }
     virtual void getTargetBuiltins(const Builtin::Info *&Records,
                                    unsigned &NumRecords) const {}
     virtual const char *getVAListDeclaration() const {
-      return "";
+      return "typedef char* __builtin_va_list;";
     }
     virtual const char *getClobbers() const {
       return "";
index a1485b65013fc2587e72983f70bd1321394629ec..cccee762e264b7119f95b8d195de8f83e3f9a0e3 100644 (file)
 //
 // RUN: %clang_cc1 -E -dM -ffreestanding -triple=pic16-none-none < /dev/null | FileCheck -check-prefix PIC16 %s
 //
-// PIC16:#define _CONFIG(conf) asm("CONFIG "#conf)
 // PIC16:#define __CHAR_BIT__ 8
 // PIC16:#define __DBL_DENORM_MIN__ 1.40129846e-45F
 // PIC16:#define __DBL_DIG__ 6
 // PIC16:#define __LONG_LONG_MAX__ 2147483647LL
 // PIC16:#define __LONG_MAX__ 2147483647L
 // PIC16:#define __NO_INLINE__ 1
+// PIC16:#define __PIC16 1
 // PIC16:#define __POINTER_WIDTH__ 16
 // PIC16:#define __PTRDIFF_TYPE__ int
 // PIC16:#define __PTRDIFF_WIDTH__ 16
 // PIC16:#define __WCHAR_WIDTH__ 16
 // PIC16:#define __WINT_TYPE__ int
 // PIC16:#define __WINT_WIDTH__ 16
+// PIC16:#define __address(Addr) __attribute__((section("Address="#Addr)))
 // PIC16:#define __clang__ 1
+// PIC16:#define __config(conf) asm("CONFIG "#conf)
+// PIC16:#define __idlocs(value) asm("__IDLOCS "#value)
 // PIC16:#define __llvm__ 1
 // PIC16:#define __pic16 1
-// PIC16:#define _address(Addr) __attribute__((section("Address="#Addr)))
-// PIC16:#define _interrupt __attribute__((section("interrupt=0x4"))) __attribute__((used))
-// PIC16:#define _section(SectName) __attribute__((section(SectName)))
+// PIC16:#define __section(SectName) __attribute__((section(SectName)))
+// PIC16:#define interrupt __attribute__((section("interrupt=0x4"))) __attribute__((used))
+// PIC16:#define near __attribute__((section("Address=NEAR")))
 // PIC16:#define ram __attribute__((address_space(0)))
 // PIC16:#define rom __attribute__((address_space(1)))
 //