blob: c06f11fd2d24d55c1fd2f800d833f38f7944267e [file] [log] [blame]
Joerg Sonnenberger4fe497d2011-05-13 21:12:10 +00001// 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
4char *strerror(int) asm("alias");
Benjamin Kramer5c247db2011-11-20 21:05:04 +00005int x __asm("foo");
Joerg Sonnenberger4fe497d2011-05-13 21:12:10 +00006
Benjamin Kramer5c247db2011-11-20 21:05:04 +00007int *test(void) {
8 static int y __asm("bar");
9 strerror(-1);
10 return &y;
Joerg Sonnenberger4fe497d2011-05-13 21:12:10 +000011}
12
Benjamin Kramer5c247db2011-11-20 21:05:04 +000013// LINUX: @bar = internal global i32 0
14// LINUX: @foo = common global i32 0
Joerg Sonnenberger4fe497d2011-05-13 21:12:10 +000015// LINUX: declare i8* @alias(i32)
Benjamin Kramer5c247db2011-11-20 21:05:04 +000016
17// DARWIN: @"\01bar" = internal global i32 0
18// DARWIN: @"\01foo" = common global i32 0
Joerg Sonnenberger4fe497d2011-05-13 21:12:10 +000019// DARWIN: declare i8* @"\01alias"(i32)