Rafael Espindola | 79ac2da | 2011-12-19 16:30:30 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-pc-linux -emit-llvm %s -o - | FileCheck %s |
Rafael Espindola | a411d2f | 2011-10-26 20:41:06 +0000 | [diff] [blame] | 2 | |
Rafael Espindola | cc4889f | 2011-10-28 20:43:56 +0000 | [diff] [blame] | 3 | extern void foo_alias (void) __asm ("foo"); |
| 4 | inline void foo (void) { |
Rafael Espindola | a411d2f | 2011-10-26 20:41:06 +0000 | [diff] [blame] | 5 | return foo_alias (); |
| 6 | } |
Rafael Espindola | cc4889f | 2011-10-28 20:43:56 +0000 | [diff] [blame] | 7 | extern void bar_alias (void) __asm ("bar"); |
| 8 | inline __attribute__ ((__always_inline__)) void bar (void) { |
| 9 | return bar_alias (); |
| 10 | } |
Rafael Espindola | bcf6b98 | 2011-12-19 14:41:01 +0000 | [diff] [blame] | 11 | extern char *strrchr_foo (const char *__s, int __c) __asm ("strrchr"); |
| 12 | extern inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char * strrchr_foo (const char *__s, int __c) { |
| 13 | return __builtin_strrchr (__s, __c); |
| 14 | } |
Rafael Espindola | cc4889f | 2011-10-28 20:43:56 +0000 | [diff] [blame] | 15 | void f(void) { |
| 16 | foo(); |
| 17 | bar(); |
Rafael Espindola | bcf6b98 | 2011-12-19 14:41:01 +0000 | [diff] [blame] | 18 | strrchr_foo("", '.'); |
Rafael Espindola | a411d2f | 2011-10-26 20:41:06 +0000 | [diff] [blame] | 19 | } |
| 20 | |
Rafael Espindola | cc4889f | 2011-10-28 20:43:56 +0000 | [diff] [blame] | 21 | // CHECK: define void @f() |
Rafael Espindola | bcb5452 | 2011-10-28 20:52:18 +0000 | [diff] [blame] | 22 | // CHECK: call void @foo() |
Rafael Espindola | cc4889f | 2011-10-28 20:43:56 +0000 | [diff] [blame] | 23 | // CHECK-NEXT: call void @bar() |
Rafael Espindola | bcf6b98 | 2011-12-19 14:41:01 +0000 | [diff] [blame] | 24 | // CHECK-NEXT: call i8* @strrchr( |
Rafael Espindola | cc4889f | 2011-10-28 20:43:56 +0000 | [diff] [blame] | 25 | // CHECK-NEXT: ret void |
| 26 | |
| 27 | // CHECK: declare void @foo() |
| 28 | // CHECK: declare void @bar() |
Rafael Espindola | bcf6b98 | 2011-12-19 14:41:01 +0000 | [diff] [blame] | 29 | // CHECK: declare i8* @strrchr(i8*, i32) |