2 ; Make sure that llvm-as/llvm-dis properly assembly/disassembly the 'builtin'
7 ; RUN: llvm-as -disable-verify < %s | \
9 ; RUN: llvm-as -disable-verify | \
11 ; RUN: FileCheck -check-prefix=CHECK-ASSEMBLES %s
13 ; CHECK-ASSEMBLES: declare i8* @foo(i8*) [[NOBUILTIN:#[0-9]+]]
14 ; CHECK-ASSEMBLES: call i8* @foo(i8* %x) [[BUILTIN:#[0-9]+]]
15 ; CHECK-ASSEMBLES: attributes [[NOBUILTIN]] = { nobuiltin }
16 ; CHECK-ASSEMBLES: attributes [[BUILTIN]] = { builtin }
18 declare i8* @foo(i8*) #1
19 define i8* @bar(i8* %x) {
20 %y = call i8* @foo(i8* %x) #0
24 ; Make sure that we do not accept the 'builtin' attribute on function
25 ; definitions, function declarations, and on call sites that call functions
26 ; which do not have nobuiltin on them.
29 ; RUN: not llvm-as <%s 2>&1 | FileCheck -check-prefix=CHECK-BAD %s
31 ; CHECK-BAD: Attribute 'builtin' can only be applied to a callsite.
32 ; CHECK-BAD-NEXT: i8* (i8*)* @car
33 ; CHECK-BAD: Attribute 'builtin' can only be applied to a callsite.
34 ; CHECK-BAD-NEXT: i8* (i8*)* @mar
38 define i8* @har(i8* %x) {
39 %y = call i8* @lar(i8* %x) #0
43 define i8* @car(i8* %x) #0 {
47 declare i8* @mar(i8*) #0
49 attributes #0 = { builtin }
50 attributes #1 = { nobuiltin }