Home | History | Annotate | Download | only in CodeGen
      1 // RUN: %clang_cc1 -triple=i686-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=LINUX
      2 // RUN: %clang_cc1 -triple=i686-apple-darwin9 -emit-llvm %s -o - | FileCheck %s --check-prefix=DARWIN
      3 
      4 char *strerror(int) asm("alias");
      5 int x __asm("foo");
      6 
      7 int *test(void) {
      8   static int y __asm("bar");
      9   strerror(-1);
     10   return &y;
     11 }
     12 
     13 // LINUX: @bar = internal global i32 0
     14 // LINUX: @foo = common global i32 0
     15 // LINUX: declare i8* @alias(i32)
     16 
     17 // DARWIN: @"\01bar" = internal global i32 0
     18 // DARWIN: @"\01foo" = common global i32 0
     19 // DARWIN: declare i8* @"\01alias"(i32)
     20 
     21 // PR7887
     22 int pr7887_1 asm("");
     23 extern int pr7887_2 asm("");
     24 int pr7887_3 () asm("");
     25 
     26 int pt7887_4 () {
     27   static int y asm("");
     28   y = pr7887_3();
     29   pr7887_2 = 1;
     30   return pr7887_1;
     31 }
     32