mirror of
https://github.com/GaloisInc/macaw.git
synced 2024-12-28 08:34:23 +03:00
arm: Add a test with mixed ARM and Thumb code
This commit is contained in:
parent
f7b87224a4
commit
c718b41dc6
@ -1,19 +1,22 @@
|
||||
A32CC=arm-none-eabi-gcc
|
||||
T32CC=arm-none-eabi-gcc -march=armv7-m
|
||||
A32CC=arm-linux-gnueabi-gcc
|
||||
# arm-none-eabi-gcc
|
||||
T32CC=arm-linux-gnueabi-gcc -mthumb
|
||||
# -march=armv7-m
|
||||
# arm-none-eabi-gcc -march=armv7-m
|
||||
|
||||
all: $(patsubst %.c,%-a32.exe,$(wildcard *.c)) $(patsubst %.c,%-t32.exe,$(wildcard *.c))
|
||||
|
||||
%-a32.exe: %.s
|
||||
%-a32.exe: %-a32.s
|
||||
$(A32CC) -fno-stack-protector -nostdlib $< -o $@
|
||||
|
||||
%-t32.exe: %.s
|
||||
%-t32.exe: %-t32.s
|
||||
$(T32CC) -fno-stack-protector -nostdlib $< -o $@
|
||||
|
||||
%-a32.s: %.c
|
||||
$(CC) -fno-stack-protector -S -c $< -o $@
|
||||
$(A32CC) -fno-stack-protector -S -c $< -o $@
|
||||
|
||||
%-t32.s: %.c
|
||||
$(CC) -march=thumb -fno-stack-protector -S -c $< -o $@
|
||||
$(T32CC) -fno-stack-protector -S -c $< -o $@
|
||||
|
||||
.PRECIOUS: %.s
|
||||
|
||||
|
20
macaw-arm/tests/arm/test-mixed.c
Normal file
20
macaw-arm/tests/arm/test-mixed.c
Normal file
@ -0,0 +1,20 @@
|
||||
#include "util.h"
|
||||
|
||||
void thumbFunc(int x, int*res) __attribute__((target("thumb")));
|
||||
void thumbFunc(int x, int* res) {
|
||||
if(x > 0) {
|
||||
x = x + 10;
|
||||
}
|
||||
|
||||
*res = x;
|
||||
}
|
||||
|
||||
void driver(int x, int* res) {
|
||||
thumbFunc(x + 1, res);
|
||||
}
|
||||
|
||||
void _start() {
|
||||
int i;
|
||||
driver((int)&driver, &i);
|
||||
EXIT();
|
||||
}
|
Loading…
Reference in New Issue
Block a user