File: FFS.ll

package info (click to toggle)
llvm 2.2-12
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 38,648 kB
  • ctags: 28,258
  • sloc: cpp: 215,479; sh: 12,132; ansic: 10,002; yacc: 5,525; perl: 2,352; ml: 1,580; makefile: 956; pascal: 718; lex: 602; exp: 320; ada: 193; lisp: 160; csh: 116; objc: 59; python: 59; tcl: 20
file content (29 lines) | stat: -rw-r--r-- 822 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
; Test that the ToAsciiOptimizer works correctly
; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \
; RUN:   not grep {call.*%ffs}

declare int %ffs(int)
declare int %ffsl(int)
declare int %ffsll(long)

%non_const = external global int

implementation   ; Functions:

int %main () {
  %arg  = load int* %non_const
  %val0 = call int %ffs(int %arg)
  %val1 = call int %ffs(int 1)
  %val2 = call int %ffs(int 2048)
  %val3 = call int %ffsl(int 65536)
  %val4 = call int %ffsll(long 1024)
  %val5 = call int %ffsll(long 17179869184)
  %val6 = call int %ffsll(long 1152921504606846976)
  %rslt1 = add int %val1, %val2
  %rslt2 = add int %val3, %val4
  %rslt3 = add int %val5, %val6
  %rslt4 = add int %rslt1, %rslt2
  %rslt5 = add int %rslt4, %rslt3
  %rslt6 = add int %rslt5, %val0
  ret int %rslt5
}